Back to OASIS3-MCT home

The models use mod_oasis and call the routines of the psmile. The routines of the psmile are sorted out below as they are called by the models.

In oasis3-mct/lib/psmile/src :

mod_oasis:  Main module of the psmile in OASIS3-MCT.
Called by the models to be able to use the routines allowing communication
with the other models of the coupling.
module mod_oasis
! !USES:
  USE mod_oasis_kinds  ,ONLY: ip_single_p
  USE mod_oasis_kinds  ,ONLY: ip_double_p
  USE mod_oasis_kinds  ,ONLY: ip_realwp_p
  USE mod_oasis_kinds  ,ONLY: ll_single
  USE mod_oasis_kinds  ,ONLY: ip_i2_p
  USE mod_oasis_kinds  ,ONLY: ip_i4_p
  USE mod_oasis_kinds  ,ONLY: ip_i8_p
  USE mod_oasis_kinds  ,ONLY: ip_intwp_p
  USE mod_oasis_parameters
  USE mod_oasis_method ,ONLY: oasis_init_comp   
  USE mod_oasis_method ,ONLY: oasis_terminate
  USE mod_oasis_method ,ONLY: oasis_get_localcomm
  USE mod_oasis_method ,ONLY: oasis_set_couplcomm
  USE mod_oasis_method ,ONLY: oasis_create_couplcomm
  USE mod_oasis_method ,ONLY: oasis_get_intracomm
  USE mod_oasis_method ,ONLY: oasis_get_intercomm
  USE mod_oasis_method ,ONLY: oasis_set_debug    
  USE mod_oasis_method ,ONLY: oasis_get_debug    
  USE mod_oasis_method ,ONLY: oasis_enddef       
  USE mod_oasis_part   ,ONLY: oasis_def_partition  
  USE mod_oasis_var    ,ONLY: oasis_def_var      
  USE mod_oasis_getput_interface ,ONLY: oasis_get
  USE mod_oasis_getput_interface ,ONLY: oasis_put  
  USE mod_oasis_grid   ,ONLY: oasis_start_grids_writing
  USE mod_oasis_grid   ,ONLY: oasis_write_grid
  USE mod_oasis_grid   ,ONLY: oasis_write_angle
  USE mod_oasis_grid   ,ONLY: oasis_write_corner       
  USE mod_oasis_grid   ,ONLY: oasis_write_mask         
  USE mod_oasis_grid   ,ONLY: oasis_write_area         
  USE mod_oasis_grid   ,ONLY: oasis_terminate_grids_writing  
  USE mod_oasis_sys    ,ONLY: oasis_abort      

  IMPLICIT NONE

!===============================================================================
end module mod_oasis

oasis_init_comp:

=> oasis_data_zero()
=> MPI_Initialized
=> oasis_unitsetmin(1024)
=> oasis_unitget
=> oasis_namcouple_init()
=> oasis_unitget(nulin)  ! To open file namcouple
=> inipar_alloc()
=> parse
=> alloc()
=> inipar()
=> parse
=> oasis_unitfree(nulin)
=> oasis_unitsetmin(maxunit) ! Maxunit : max of unit used by all the models read in the namcouple
=> dealloc()
=> MPI_COMM_SPLIT (to get the mpi_comm_local of each model)
=> oasis_unitget(iu)
=> oasis_mpi_bcast
=> oasis_debug_enter
=> oasis_timer_init
=> oasis_timer_start('total after init')
=> oasis_debug_exit


oasis_get_localcomm:
oasis_start_grids_writing:
oasis_write_grid:
oasis_write_corner:
oasis_write_mask:
oasis_terminate_grids_writing:
oasis_def_partition:
oasis_def_var:

definition of the number of the variable prism_nvar (= id_nports)
definition of the global structure prism_var

oasis_enddef:

=> oasis_debug_enter
=> oasis_write2files
=> oasis_mpi_barrier
=> oasis_mpi_max
=> mct_world_init
=> oasis_coupler_setup
=> oasis_advance_init
=> prism_timer_start
Loop cplid = 1,prism_ncoupler
if (getput == PRISM_PUT .and. lag > 0) then  (reading of the restart file)
=> mct_aVect_init (avtmp,rlist=prism_coupler(cplid)%fldlist,lsize=lsize)
=> prism_io_read_avfile (trim(rstfile),avtmp,prism_part(partid)%gsmap)
=> prism_advance_run (PRISM_Out,varid,msec,array,kinfo)
=> mct_avect_clean
endif
if (getput == PRISM_PUT .and. prism_coupler(cplid)%trans /= ip_instant) then  (reading of the restart LOCTRANS file)
=> prism_io_read_avfile(rstfile,prism_coupler(cplid)%avect1,prism_part(partid)%gsmap,abort=.false.)  ! read the restart
=> prism_io_read_array(rstfile,iarray=prism_coupler(cplid)%avcnt,ivarname=trim(vstring),abort=.false.) ! read the number of counts (?)
endif
end Loop
=> prism_timer_stop
=> oasis_debug_exit

oasis_put:  == oasis_put (id_port_id,kstep,wr_field,kinfo)
=> prism_advance_run (PRISM_Out,nfld,kstep,array,kinfo)
if (getput == PRISM_PUT .and. lag > 0) then
=> prism_timer_start (tstring)
=> prism_io_write_avfile(rstfile,prism_coupler(cplid)%avect1,prism_part(partid)%gsmap,nx,ny)
=> prism_timer_stop (tstring)
endif
if (sndrcv) then
if (getput == PRISM_PUT) then
if (snddiag) then
=> prism_advance_avdiag(prism_coupler(cplid)%avect1,mpi_comm_local)
endif
if (mapid > 0) then
=> prism_timer_start(tstring)
=> mct_avect_zero(prism_coupler(cplid)%avect2)
=> prism_advance_map(prism_coupler(cplid)%avect1,prism_coupler(cplid)%avect2,prism_mapper(mapid),conserv)
=> prism_timer_stop(tstring)
=> prism_timer_start(tstring)
=> mct_waitsend(prism_router(rouid)%router)
=> mct_isend(prism_coupler(cplid)%avect2,prism_router(rouid)%router,tag)
=> prism_timer_stop(tstring)
else !mapid
=> prism_timer_start(tstring)
=> mct_waitsend(prism_router(rouid)%router)
=> mct_isend(prism_coupler(cplid)%avect1,prism_router(rouid)%router,tag)
=> prism_timer_stop(tstring)
endif
endif
endif
if (output) then
=> prism_timer_start(tstring)
=> prism_io_write_avfbf(prism_coupler(cplid)%avect1,prism_part(partid)%gsmap,nx,ny,msec,fstring)
=> prism_timer_stop(tstring)
endif

oasis_get: == oasis_get (id_port_id,kstep,rd_field,kinfo)
=> prism_advance_run (PRISM_In,nfld,kstep,array,kinfo)

oasis_terminate:
=> oasis_debug_enter
=> oasis_timer_stop('total after init') ! In file *timer*, give the total time without initialisation (ie reading namcouple ...)
=> oasis_timer_print()
=> oasis_mpi_barrier(mpi_comm_global)
=> oasis_debug_exit