Structure of the oasis routines

This page should outline where the oasis code under the directory /control/coupling appears in the UM and what is does

For OASIS-MCT both OASIS3 and MCT are macro which are defined

The modules

The modules are

  • OASIS_ATM_DATA_MOD. This
    • defines all the variables and pointers we need, many of these are allocatable arrays, which will be allocated later
    • define the TYPE TRANSIENT
    • defines the namelists TRANSCOUNT and TRANSFLD
    • defines the vind_* values
  • OASIS3_ATMOS_INIT_MOD
  • OASIS3_SPLIT_COMM_MOD (for MCT only)

The routines

UM_SHELL does the following

  • Call OASIS_READ_TRANSLIST, which reads the namcouple file and sets %grid, %name, %indx and %field_id for both transient_out(i_number) and transient_in(i_number)
  • Further calls to various GC_ routines to set up MPI in UM_SHELL
  • Call OASIS3_SPLIT_COMM (for MCT only)
  • Call OASIS3_GRID(.FALSE.), which
    • Defines the var_shape variable needed for later
    • Defines the %oasis_id values for transient_out(tc) and transient_in(tc), using calls to PRISM_DEF_VAR_PROTO
  • Call in UM_SHELL to U_MODEL_4A
    • Calls INITIAL_4A, which
      • Determine the coupling frequency, oasis_couple_ts
      • calls OASIS3_GRID(.TRUE.), which does the same as OASIS3_GRID(.FALSE.), but for a much bigger list of variables - which includes the main coupled arrays.
      • calls OASIS_INIT*, which
        • Set all the coupled variable flags, like l_u_cpl, to .FALSE.
        • Sets the oasis_?mt* lengths
        • Allocates the size of the arrays used for passing the coupled fields, like ocn_sst.
        • Calls OASIS_PROCESS_TRANSLIST, which sets transient_in(:)%polar_mean to .TRUE. if required
        • Calls OASIS_POINT_TRANSLIST, which points both transient_out(tc)%field and transient_in(tc)%field at the coupled arrays, e.g.
              IF (transient_out(tc)%field_id == vind_heatflux) THEN
                l_heatflux = .TRUE.
                transient_out(tc)%field => heatflux(:,:)
              END IF
          
                 
        • Sets the ja_* values, using FINDPTR, which located the variables in the STASH D1 array
  • Runs the main timestep loop
    • Sets put_step (which timestep to put OASIS fields), get_step (which timestep to get OASIS fields) and cpl_update_step (which timestep to call OASIS_UPDATECPL*). For each cycle, cpl_update_step is true at first timestep only, and get_step and put_step are true at second timestep only.
    • Call OASIS3_GET*, which
      • Sets some arrays ready for arrival of coupling variables
      • Receives 2D slices using OASIS3_GET
      • Corrects if any polar problem with call to MEAN_POLAR_ROW.
      • Uses the received coupled variables to calculate the fields we want
    • Call OASIS3_PUT*. Set contents of arrays used for coupling and calls OASIS3_PUT, which transfers the 2D slices using OASIS.
    • Call OASIS3_ADVANCE_DATE
    • Call OASIS_UPDATECPL. Sets contents of arrays used for coupling from the D1 arrays (before they're changed from the following diagnostic calls)
    • Diagnostic updates
  • Calls OASIS_TIDY*. Deallocate all the arrays, like ocn_sst, which were passed with OASIS-MCT.