Back to OASIS3 home

Arborescence of the coupler (in oasis3/src) :

couple.F
: (main program)

If OASIS3 is parallel
=> MPI_Init
=> MPI_Comm_Rank
else nothing
=> call prcout (to print that configuration file namcouple was opened correctly)
=> call driver

driver.F : (contains the time loop, from 0 to niter-1)
=> call inipar_alloc (initialize main run parameters)
=> call alloc(il_flag==1) (allocate arrays defined in the modules (first round))
=> call inipar (initialize other run parameters)
=> call inilun (initialize logical unit numbers)
=> call initim (initialize time information)
=> call inicmc (initialize communication between processes ie initialize the coupling)
=> call chksgc
=> call CLIM_Init_Oasis (CLIM/MPI2 or MPI1 initialization)                                            ----------------------> the routine is located in oasis3/lib/clim/src
=> call CLIM_Define (input ports for incoming fields)                                                         ----------------------> the routine is located in oasis3/lib/clim/src
=> call CLIM_Define (output ports for outgoing fields : serial decomposition)                   ----------------------> the routine is located in oasis3/lib/clim/src
=> call CLIM_Start(infos) (start the communication)                                                            ----------------------> the routine is located in oasis3/lib/clim/src
=> call CLIM_Stepi(cmodnam(jm), infos) (get timestep information)                                  ----------------------> the routine is located in oasis3/lib/clim/src
=> call alloc(il_flag==2) (allocate arrays (second round))
=> call inidya (set up dynamic allocation for all grid-related fields)
=> call iniiof (open necessary files)
=> call chkpar (check run parameters compatibility between GCM's and coupler)
=> call inigrd (initialize GCM's grids)
A-Time loop (icount = iter * nstep)
=> call updtim(iter) (update calendar date)
B-Loop on number of sequential models
C-Loop on number of fields to find active fields for current iteration
If time_step == mulitiple of the coupling period
There are ifield fields to be exchanged for iteration jt
End loop C
=> call getfld (iindex, ifield, iter) (get fields)
=> call preproc (iindex, ifield) (do preprocessing)
=> call interp (iindex, ifield) (do the interpolation for all the fields)
'INTERP'
=> call szero
=> call fiasco
'NOINTERP' : output field is equal to input field
'MOZAIC'
=> call mozaic
'SCRIPR'
If vector interpolation
=> call scriprmp_vector
else
=> call scriprmp                                                             ----------------------> the routine is located in oasis3/lib/scrip/src
Endif
=> call cookart (iindex, ifield) (do the nitty gritty stuff == what has to be done : do subgrid variability, flux conservation or basic linear algebra stuff)
IF (canal(ja,ifield) .EQ. 'CONSERV') THEN
=> call conserv (fldold(iadrold), isizold,
     $                      mskold(iadrold_grid), surold(iadrold_grid),
     $                      fldnew(iadrnew), isiznew,
     $                      msknew(iadrnew_grid), surnew(iadrnew_grid),
     $                      work(1), work(1+isizold), clconmet)
ELSE IF (canal(ja,ifield) .EQ. 'SUBGRID') THEN
ELSE IF (canal(ja,ifield) .EQ. 'BLASNEW') THEN
ENDIF
=> call postpro (iindex, ifield) (do postprocessing)
=> call givfld (iindex, ifield, iter) (give back fields)
End loop B
=> call closerst (if iter == 0, close units or netcdf restart files if first iteration)
=> call reset (reset macro arrays)
End loop time A
=> call waitpc (wait until end of child processes)
=> call dealloc (deallocation of arrays allocated in "inialloc" routine)

inipar.F : (reads and prints out run parameters)
Reading of the elements of the namcouple

interp.F : (monitor the field interpolation and auxilary analysis)
=> call prtout
Interpolation with the SCRIP library
=> call scriprmp (                                                                               ----------------------> the routine is located in oasis3/lib/scrip/src
     $                   fldnew(iadrnew), fldold(iadrold),
     $                   isizold, isiznew,
     $                   mskold(iadrold_grid), msknew(iadrnew_grid),
     $                   xgrold(iadrold_grid), ygrold(iadrold_grid),
     $                   ilonbf, ilatbf,
     $                   xgrnew(iadrnew_grid), ygrnew(iadrnew_grid),
     $                   ilonaf, ilataf,
     $                   cmap_method(ifield), clgrdtyp,
     $                   il_sper, il_tper, clsper, cltper,
     $                   cficbf(ifield), cficaf(ifield),
     $                   cnorm_opt(ifield),
     $                   corder(ifield), crsttype(ifield),
     $                   nbins(ifield),
     $                   lextrapdone(ifield), varmul(ifield),
     $                   nscripvoi(ifield),
     $                   ifield, ig_nfield)