New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 13443 – NEMO

Changeset 13443


Ignore:
Timestamp:
2020-08-28T17:01:04+02:00 (4 years ago)
Author:
frrh
Message:

Commit changes which allow first working 2 way coupling exchanges between GO8
and LFRic aquaplanet.

Location:
NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2/src/OCE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2/src/OCE/SBC/cpl_oasis3.F90

    r13311 r13443  
    7676   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information 
    7777      LOGICAL               ::   laction   ! To be coupled or not 
    78       CHARACTER(len = 8)    ::   clname    ! Name of the coupling field    
     78      CHARACTER(len = 30)    ::   clname    ! Name of the coupling field    
    7979      CHARACTER(len = 1)    ::   clgrid    ! Grid type   
    8080      REAL(wp)              ::   nsgn      ! Control of the sign change 
     
    164164      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~' 
    165165      IF(lwp) WRITE(numout,*) 
     166 
     167      WRITE(numout,*) "RSRH inside cpl_define" ; flush(numout) 
    166168 
    167169      ncplmodel = kcplmodel 
     
    212214         WRITE(numout,*) ' multiexchg: nldj, nlej, njmpp =', nldj, nlej, njmpp 
    213215      ENDIF 
    214     
     216       WRITE(numout,*) "RSRH calling def partition" ; flush(numout) 
     217 
     218   
    215219      CALL oasis_def_partition ( id_part, paral, nerror, jpiglo*jpjglo ) 
     220       WRITE(numout,*) "RSRH called def partition" ; flush(numout) 
    216221      ! 
    217222      ! ... Announce send variables.  
     
    247252#endif 
    248253                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_Out 
     254       WRITE(numout,*) "RSRH calling def var send", zclname , ji; flush(numout) 
    249255                  CALL oasis_def_var (ssnd(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 1 /),   & 
    250256                     &                OASIS_Out          , ishape , OASIS_REAL, nerror ) 
     257       WRITE(numout,*) "RSRH called def var", zclname , ji, nerror; flush(numout) 
    251258                  IF ( nerror /= OASIS_Ok ) THEN 
    252259                     WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) 
     
    292299#endif 
    293300                  IF( ln_ctl ) WRITE(numout,*) "Define", ji, jc, jm, " "//TRIM(zclname), " for ", OASIS_In 
     301       WRITE(numout,*) "RSRH calling def var recv", zclname , ji; flush(numout) 
    294302                  CALL oasis_def_var (srcv(ji)%nid(jc,jm), zclname, id_part   , (/ 2, 1 /),   & 
    295303                     &                OASIS_In           , ishape , OASIS_REAL, nerror ) 
     304       WRITE(numout,*) "RSRH called def var recv", zclname , ji, nerror; flush(numout) 
    296305                  IF ( nerror /= OASIS_Ok ) THEN 
    297306                     WRITE(numout,*) 'Failed to define transient ', ji, jc, jm, " "//TRIM(zclname) 
     
    309318      ! End of definition phase 
    310319      !------------------------------------------------------------------ 
     320       WRITE(numout,*) "RSRH calling endef "; flush(numout) 
    311321       
    312322      CALL oasis_enddef(nerror) 
     323       WRITE(numout,*) "RSRH called endef "; flush(numout) 
    313324      IF( nerror /= OASIS_Ok )   CALL oasis_abort ( ncomp_id, 'cpl_define', 'Failure in oasis_enddef') 
    314325      ! 
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2/src/OCE/SBC/sbc_oce.F90

    r11715 r13443  
    4040#endif 
    4141   LOGICAL , PUBLIC ::   ln_cpl         !: ocean-atmosphere coupled formulation 
     42   LOGICAL , PUBLIC ::   ln_couple_test !: ocean-atmosphere test coupling ONLY - non-coupled forcing 
    4243   LOGICAL , PUBLIC ::   ln_mixcpl      !: ocean-atmosphere forced-coupled mixed formulation 
    4344   LOGICAL , PUBLIC ::   ln_dm2dc       !: Daily mean to Diurnal Cycle short wave (qsr) 
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2/src/OCE/SBC/sbccpl.F90

    r13311 r13443  
    116116   INTEGER, PARAMETER ::   jpr_tauwy  = 56   ! y component of the ocean stress from waves 
    117117   INTEGER, PARAMETER ::   jpr_ts_ice = 57   ! Sea ice surface temp 
    118  
    119    INTEGER, PARAMETER ::   jprcv      = 57   ! total number of fields received   
     118   INTEGER, PARAMETER ::   jpr_dummy_t = 58  ! Dummy test incoming coupling tracer grid field 
     119 
     120   INTEGER, PARAMETER ::   jprcv      = 58   ! total number of fields received   
    120121 
    121122   INTEGER, PARAMETER ::   jps_fice   =  1   ! ice fraction sent to the atmosphere 
     
    157158   INTEGER, PARAMETER ::   jps_sstfrz = 37   ! sea surface freezing temperature 
    158159   INTEGER, PARAMETER ::   jps_ttilyr = 38   ! sea ice top layer temp 
    159  
    160    INTEGER, PARAMETER ::   jpsnd      = 38   ! total number of fields sent  
     160   INTEGER, PARAMETER ::   jps_dummy_t = 39  ! Dummy test outgoing coupling tracer grid field 
     161 
     162   INTEGER, PARAMETER ::   jpsnd      = 39   ! total number of fields sent  
    161163 
    162164   !                                  !!** namelist namsbc_cpl ** 
     
    278280         WRITE(numout,*)'~~~~~~~~~~~~' 
    279281      ENDIF 
    280       IF( lwp .AND. ln_cpl ) THEN                        ! control print 
     282      IF( lwp .AND. (ln_cpl .OR. ln_couple_test) ) THEN                        ! control print 
    281283         WRITE(numout,*)'  received fields (mutiple ice categogies)' 
    282284         WRITE(numout,*)'      10m wind module                 = ', TRIM(sn_rcv_w10m%cldes  ), ' (', TRIM(sn_rcv_w10m%clcat  ), ')' 
     
    723725         ENDIF 
    724726      ENDIF 
    725        
     727 
     728 
     729      IF (ln_couple_test) THEN 
     730         ! If we're just running a test coupled job then set all  
     731         ! actions to false for all fields apart from our test field(s) 
     732         srcv(:)%laction = .FALSE. 
     733 
     734 
     735         srcv(jpr_dummy_t)%clname = 'R_OC_DUMMY_T'    
     736         srcv(jpr_dummy_t)%laction = .TRUE. 
     737      ENDIF 
     738 
    726739      ! =================================================== ! 
    727740      ! Allocate all parts of frcv used for received fields ! 
     
    742755         IF ( .NOT. srcv(jpr_ity1)%laction ) ALLOCATE( frcv(jpr_ity1)%z3(jpi,jpj,srcv(jpr_ity1)%nct) ) 
    743756      END IF 
     757 
     758 
     759 
     760 
    744761 
    745762      ! ================================ ! 
     
    10311048      ENDIF 
    10321049 
     1050      IF (ln_couple_test) THEN 
     1051         ! If we're just running a test coupled job then set all  
     1052         ! actions to false for all fields apart from our test field(s) 
     1053         ssnd(:)%laction = .FALSE. 
     1054 
     1055 
     1056         ssnd(jps_dummy_t)%clname = 'S_OC_DUMMY_T'    
     1057         ssnd(jps_dummy_t)%laction = .TRUE. 
     1058      ENDIF 
     1059 
     1060 
    10331061      ! 
    10341062      ! ================================ ! 
     
    10371065 
    10381066      ! If ln_cpl is false, clearly we don't want to call cpl_dfine! 
    1039       if (ln_cpl) CALL cpl_define(jprcv, jpsnd, nn_cplmodel) 
    1040        
     1067      IF (ln_cpl .OR. ln_couple_test) THEN 
     1068           write(numout,*) "RSRH call cpl_define", ln_cpl ,ln_couple_test ; flush(numout) 
     1069         CALL cpl_define(jprcv, jpsnd, nn_cplmodel) 
     1070 
     1071      ENDIF       
     1072           write(numout,*) "RSRH after cpl_define", ln_cpl ,ln_couple_test ; flush(numout) 
     1073 
     1074 
    10411075      IF (ln_usecplmask) THEN  
    10421076         xcplmask(:,:,:) = 0. 
     
    11271161      !                                                      ! ======================================================= ! 
    11281162      isec = ( kt - nit000 ) * NINT( rdt )                      ! date of exchanges 
     1163 
     1164 
     1165      WRITE(numout,*) "RSRH in sbc_cpl_rcv" ; flush(numout) 
     1166 
    11291167      DO jn = 1, jprcv                                          ! received fields sent by the atmosphere 
    1130          IF( srcv(jn)%laction )   CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 
     1168 
     1169        WRITE(numout,*) "RSRH in sbc_cpl_rcv for field" ,jn, srcv(jn)%laction ;flush(numout) 
     1170 
     1171         IF( srcv(jn)%laction ) THEN 
     1172        WRITE(numout,*) "RSRH call cpl_rcv for field", jn, srcv(jn)%laction ;flush(numout) 
     1173               CALL cpl_rcv( jn, isec, frcv(jn)%z3, xcplmask(:,:,1:nn_cplmodel), nrcvinfo(jn) ) 
     1174        WRITE(numout,*) "RSRH  done cpl_rcv for field", jn, srcv(jn)%laction, nrcvinfo(jn) ;flush(numout) 
     1175         ENDIF 
    11311176      END DO 
    11321177 
     1178      WRITE(numout,*) "RSRH in sbc_cpl_rcv after all gets" ; flush(numout) 
    11331179      !                                                      ! ========================= ! 
    11341180      IF( srcv(jpr_otx1)%laction ) THEN                      !  ocean stress components  ! 
     
    25952641      IF( ssnd(jps_sstfrz)%laction )  CALL cpl_snd( jps_sstfrz, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info) 
    25962642#endif 
     2643 
     2644      WRITE(numout,*) "RSRH at send for ocean dummy_t"; flush(numout) 
     2645 
     2646      IF ( ssnd(jps_dummy_t)%laction ) THEN 
     2647         ! RSRH Just set up some arbitrary test pattern for now 
     2648         ztmp1(:,:) = 1.23456 
     2649      WRITE(numout,*) "RSRH call send for ocean dummy_t"; flush(numout) 
     2650         CALL cpl_snd( jps_dummy_t, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info ) 
     2651      WRITE(numout,*) "RSRH done send for ocean dummy_t", info; flush(numout) 
     2652      ENDIF 
     2653 
    25972654      ! 
    25982655   END SUBROUTINE sbc_cpl_snd 
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2/src/OCE/SBC/sbcmod.F90

    r11914 r13443  
    9898         &             ln_rnf   , nn_fwb   , ln_ssr   , ln_isf    , ln_apr_dyn ,     & 
    9999         &             ln_wave  , ln_cdgw  , ln_sdw   , ln_tauwoc  , ln_stcor   ,     & 
    100          &             ln_tauw  , nn_lsm, nn_sdrift 
     100         &             ln_tauw  , nn_lsm, nn_sdrift, ln_couple_test 
    101101      !!---------------------------------------------------------------------- 
    102102      ! 
     
    139139         WRITE(numout,*) '      Type of coupling (Ocean/Ice/Atmosphere) : ' 
    140140         WRITE(numout,*) '         ocean-atmosphere coupled formulation       ln_cpl        = ', ln_cpl 
     141         WRITE(numout,*) '         ocean-atmos test coupling ONLY             ln_couple_test   = ', ln_couple_test 
    141142         WRITE(numout,*) '         mixed forced-coupled     formulation       ln_mixcpl     = ', ln_mixcpl 
    142143!!gm  lk_oasis is controlled by key_oasis3  ===>>>  It shoud be removed from the namelist  
     
    208209      END SELECT 
    209210      !                             !* coupled options 
    210       IF( ln_cpl ) THEN 
     211      IF( ln_cpl .OR. ln_couple_test ) THEN 
    211212         IF( .NOT. lk_oasis )   CALL ctl_stop( 'sbc_init : coupled mode with an atmosphere model (ln_cpl=T)',   & 
    212213            &                                  '           required to defined key_oasis3' ) 
     
    275276      IF( icpt /= 1 )    CALL ctl_stop( 'sbc_init : choose ONE and only ONE sbc option' ) 
    276277      ! 
    277       IF(lwp) THEN                     !- print the choice of surface flux formulation 
     278!RSRH      IF(lwp) THEN                     !- print the choice of surface flux formulation 
    278279         WRITE(numout,*) 
    279280         SELECT CASE( nsbc ) 
     
    287288         END SELECT 
    288289         IF( ll_not_nemo  )       WRITE(numout,*) '               + OASIS coupled SAS' 
    289       ENDIF 
     290!RSRH      ENDIF 
    290291      ! 
    291292      !                             !* OASIS initialization 
     
    421422      !                                            !==  sbc formulation  ==! 
    422423      !                                                    
     424WRITE(numout,*) "RSRH nsbc setting=", nsbc ;flush(numout) 
     425       
     426 
     427 
    423428      SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition 
    424429      !                                                  ! (i.e. utau,vtau, qns, qsr, emp, sfx) 
     
    432437      CASE( jp_none    ) 
    433438         IF( ll_opa    )       CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! OPA-SAS coupling: OPA receiving fields from SAS 
     439 
    434440      END SELECT 
    435441      ! 
    436442      IF( ln_mixcpl )          CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
     443 
     444      ! RSRH for test/dev only   
     445      IF( ln_couple_test )      CALL sbc_cpl_rcv   ( kt, nn_fsbc, nn_ice )   ! Purely for testing/development of 
     446                                                                             ! coupled models if none of the above 
     447                                                                             ! cases are true. In this case we are likely 
     448                                                                             ! be running a forced configuration and 
     449                                                                             ! simply exchanging dummy fields which 
     450                                                                             ! have no bearing on model evolution.          
    437451      ! 
    438452      IF ( ln_wave .AND. (ln_tauwoc .OR. ln_tauw) ) CALL sbc_wstress( )      ! Wind stress provided by waves  
  • NEMO/branches/UKMO/NEMO_4.0.1_NGMS_couple_stage2/src/OCE/nemogcm.F90

    r13311 r13443  
    203203            ! RSRH. You can compile with OASIS but not want to do any 
    204204            ! coupling. We need to cater for that properly! 
    205             IF (ln_cpl) CALL sbc_cpl_snd( istp )  ! Coupling to atmos 
     205            IF (ln_cpl .OR. ln_couple_test) CALL sbc_cpl_snd( istp )  ! Coupling to atmos 
     206            ! RSRH. For test purposes we call the receive here. For proper 
     207            ! runs we need to do this elsewhere (reference UKESM/GC3 etc)   
     208            !IF (ln_cpl .OR. ln_couple_test) CALL sbc_cpl_rcv( istp )  ! Coupling from atmos 
    206209 
    207210            CALL stp        ( istp )  
     
    303306      IF( lk_oasis ) THEN 
    304307          CALL mpi_init(nerror) 
    305           CALL oasis_init_comp ( ncomp_id, "toyoce", nerror, .FALSE. ) 
     308          CALL oasis_init_comp ( ncomp_id, "toyoce", nerror, .TRUE. ) 
    306309!          CALL cpl_init( "toyoce", ilocal_comm )  
    307310          CALL oasis_get_localcomm ( ilocal_comm , nerror ) 
Note: See TracChangeset for help on using the changeset viewer.