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 7672 for branches/UKMO – NEMO

Changeset 7672 for branches/UKMO


Ignore:
Timestamp:
2017-02-13T10:27:46+01:00 (7 years ago)
Author:
jcastill
Message:

Further changes to remove the UM dependency in case of a coupled run, so that ocean can also run in coupled mode with a wave model only: until now, if running in forced/coupled mode (ln_mixcpl), the program expected forcing files and coupling fields from the atmosphere, and they were 'merged' together using a coupling map; if the coupling map was not provided, the coupling fields overwrote the input fields even if they were not actually coupled and did not have any valid information. If we were coupling to a wave model and not an atmosphere model, the forcing fields read from file were being overwritten but the atmosphere coupling fields, which did not contain any valid information.

Now, it is possible to couple in real mixed mode, where the fields can independently be read either from forcing files or from coupling (ocean coupled to an atmosphere model, a wave model, or both), and the coupling mapping is only needed if a field if both provided via coupling and a forcing file.

Location:
branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM/CONFIG/SHARED/namelist_ref

    r7481 r7672  
    240240   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    241241   ln_blk_mfs  = .false.   !  MFS bulk formulation                      (T => fill namsbc_mfs ) 
    242    ln_cpl      = .false.   !  atmosphere coupled   formulation          ( requires key_oasis3 ) 
    243    ln_mixcpl   = .false.   !  forced-coupled mixed formulation          ( requires key_oasis3 ) 
     242   ln_cpl      = .false.   !  coupled   formulation                       ( requires key_oasis3 ) 
     243   ln_mixcpl   = .false.   !  forced-coupled mixed atmosphere formulation ( requires key_oasis3 ) 
     244   ln_wavcpl   = .false.   !  forced-coupled mixed wave       formulation ( requires key_oasis3 ) 
    244245   nn_components = 0       !  configuration of the opa-sas OASIS coupling 
    245246                           !  =0 no opa-sas OASIS coupling: default single executable configuration 
  • branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r7471 r7672  
    4242   LOGICAL , PUBLIC ::   ln_cpl         !: ocean-atmosphere coupled formulation 
    4343   LOGICAL , PUBLIC ::   ln_mixcpl      !: ocean-atmosphere forced-coupled mixed formulation 
     44   LOGICAL , PUBLIC ::   ln_wavcpl      !: ocean-wave forced-coupled mixed formulation 
     45   LOGICAL , PUBLIC ::   ll_purecpl     !: ocean-atmosphere or ocean-wave pure coupled formulation 
    4446   LOGICAL , PUBLIC ::   ln_dm2dc       !: Daily mean to Diurnal Cycle short wave (qsr) 
    4547   LOGICAL , PUBLIC ::   ln_rnf         !: runoffs / runoff mouths 
  • branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90

    r7481 r7672  
    10961096         ! 
    10971097         IF( ln_mixcpl ) THEN 
    1098             utau(:,:) = utau(:,:) * xcplmask(:,:,0) + frcv(jpr_otx1)%z3(:,:,1) * zmsk(:,:) 
    1099             vtau(:,:) = vtau(:,:) * xcplmask(:,:,0) + frcv(jpr_oty1)%z3(:,:,1) * zmsk(:,:) 
    1100             taum(:,:) = taum(:,:) * xcplmask(:,:,0) + frcv(jpr_taum)%z3(:,:,1) * zmsk(:,:) 
    1101             wndm(:,:) = wndm(:,:) * xcplmask(:,:,0) + frcv(jpr_w10m)%z3(:,:,1) * zmsk(:,:) 
    1102          ELSE 
     1098            IF( srcv(jpr_otx1)%laction ) THEN 
     1099               utau(:,:) = utau(:,:) * xcplmask(:,:,0) + frcv(jpr_otx1)%z3(:,:,1) * zmsk(:,:) 
     1100               vtau(:,:) = vtau(:,:) * xcplmask(:,:,0) + frcv(jpr_oty1)%z3(:,:,1) * zmsk(:,:) 
     1101            ENDIF 
     1102            IF( srcv(jpr_taum)%laction .OR. (.NOT.srcv(jpr_taum)%laction .AND. srcv(jpr_otx1)%laction .AND. llnewtx ))   & 
     1103               taum(:,:) = taum(:,:) * xcplmask(:,:,0) + frcv(jpr_taum)%z3(:,:,1) * zmsk(:,:) 
     1104            IF( srcv(jpr_w10m)%laction .OR. (.NOT.srcv(jpr_w10m)%laction .AND. llnewtau .AND.                            & 
     1105               (srcv(jpr_taum)%laction .OR. (.NOT.srcv(jpr_taum)%laction .AND. srcv(jpr_otx1)%laction .AND. llnewtx )))) & 
     1106               wndm(:,:) = wndm(:,:) * xcplmask(:,:,0) + frcv(jpr_w10m)%z3(:,:,1) * zmsk(:,:) 
     1107         ELSE IF( ll_purecpl ) THEN 
    11031108            utau(:,:) = frcv(jpr_otx1)%z3(:,:,1) 
    11041109            vtau(:,:) = frcv(jpr_oty1)%z3(:,:,1) 
     
    12421247               CALL ctl_stop( 'sbc_cpl_rcv: wrong definition of sn_rcv_emp%cldes' ) 
    12431248            END SELECT 
    1244          ELSE 
     1249         ELSE IF( ll_purecpl ) THEN 
    12451250            zemp(:,:) = 0._wp 
    12461251         ENDIF 
     
    12501255         IF( srcv(jpr_cal)%laction )     zemp(:,:) = zemp(:,:) - frcv(jpr_cal)%z3(:,:,1) 
    12511256          
    1252          IF( ln_mixcpl ) THEN   ;   emp(:,:) = emp(:,:) * xcplmask(:,:,0) + zemp(:,:) * zmsk(:,:) 
    1253          ELSE                   ;   emp(:,:) =                              zemp(:,:) 
     1257         IF( ln_mixcpl .AND. ( srcv(jpr_oemp)%laction .OR. srcv(jpr_rain)%laction )) THEN 
     1258                                         emp(:,:) = emp(:,:) * xcplmask(:,:,0) + zemp(:,:) * zmsk(:,:) 
     1259         ELSE IF( ll_purecpl ) THEN  ;   emp(:,:) =                              zemp(:,:) 
    12541260         ENDIF 
    12551261         ! 
     
    12661272            ENDIF 
    12671273         ENDIF 
    1268          IF( ln_mixcpl ) THEN   ;   qns(:,:) = qns(:,:) * xcplmask(:,:,0) + zqns(:,:) * zmsk(:,:) 
    1269          ELSE                   ;   qns(:,:) =                              zqns(:,:) 
     1274         IF( ln_mixcpl .AND. ( srcv(jpr_qnsoce)%laction .OR. srcv(jpr_qnsmix)%laction )) THEN 
     1275                                          qns(:,:) = qns(:,:) * xcplmask(:,:,0) + zqns(:,:) * zmsk(:,:) 
     1276         ELSE IF( ll_purecpl ) THEN   ;   qns(:,:) =                              zqns(:,:) 
    12701277         ENDIF 
    12711278 
     
    12761283         ENDIF 
    12771284         IF( ln_dm2dc .AND. ln_cpl )   zqsr(:,:) = sbc_dcy( zqsr )   ! modify qsr to include the diurnal cycle 
    1278          IF( ln_mixcpl ) THEN   ;   qsr(:,:) = qsr(:,:) * xcplmask(:,:,0) + zqsr(:,:) * zmsk(:,:) 
    1279          ELSE                   ;   qsr(:,:) =                              zqsr(:,:) 
     1285         IF( ln_mixcpl .AND. ( srcv(jpr_qsroce)%laction .OR. srcv(jpr_qsrmix)%laction )) THEN 
     1286                                          qsr(:,:) = qsr(:,:) * xcplmask(:,:,0) + zqsr(:,:) * zmsk(:,:) 
     1287         ELSE IF( ll_purecpl ) THEN   ;   qsr(:,:) =                              zqsr(:,:) 
    12801288         ENDIF 
    12811289         ! 
  • branches/UKMO/r6232_INGV1_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r7620 r7672  
    8989         &             ln_blk_mfs, ln_apr_dyn, nn_ice, nn_ice_embd, ln_dm2dc   , ln_rnf   ,   & 
    9090         &             ln_ssr    , nn_isf    , nn_fwb, ln_cdgw    , ln_wave    , ln_sdw   ,   & 
    91          &             ln_tauoc  , ln_stcor  , nn_lsm, nn_limflx , nn_components, ln_cpl 
     91         &             ln_tauoc  , ln_stcor  , nn_lsm, nn_limflx , nn_components, ln_cpl  ,   & 
     92         &             ln_wavcpl 
    9293      INTEGER  ::   ios 
    9394      INTEGER  ::   ierr, ierr0, ierr1, ierr2, ierr3, jpm 
    94       LOGICAL  ::   ll_purecpl 
    9595      !!---------------------------------------------------------------------- 
    9696 
     
    131131         WRITE(numout,*) '              MFS  bulk  formulation                     ln_blk_mfs  = ', ln_blk_mfs 
    132132         WRITE(numout,*) '              ocean-atmosphere coupled formulation       ln_cpl      = ', ln_cpl 
    133          WRITE(numout,*) '              forced-coupled mixed formulation           ln_mixcpl   = ', ln_mixcpl 
     133         WRITE(numout,*) '              forced-coupled atm mixed formulation       ln_mixcpl   = ', ln_mixcpl 
     134         WRITE(numout,*) '              forced-coupled wav mixed formulation       ln_wavcpl   = ', ln_wavcpl 
    134135         WRITE(numout,*) '              wave physics                               ln_wave     = ', ln_wave  
    135136         WRITE(numout,*) '                 Stokes drift corr. to vert. velocity    ln_sdw      = ', ln_sdw  
     
    169170      IF ( nn_components == jp_iam_opa .AND. ln_cpl )   & 
    170171         &      CALL ctl_stop( 'STOP', 'sbc_init : OPA-SAS coupled via OASIS, but ln_cpl = T in OPA' ) 
    171       IF ( nn_components == jp_iam_opa .AND. ln_mixcpl )   & 
    172          &      CALL ctl_stop( 'STOP', 'sbc_init : OPA-SAS coupled via OASIS, but ln_mixcpl = T in OPA' ) 
     172      IF ( nn_components == jp_iam_opa .AND. ( ln_mixcpl .OR. ln_wavcpl) )   & 
     173         &      CALL ctl_stop( 'STOP', 'sbc_init : OPA-SAS coupled via OASIS, but ln_mixcpl or ln_wavcpl = T in OPA' ) 
    173174      IF ( ln_cpl .AND. .NOT. lk_oasis )    & 
    174175         &      CALL ctl_stop( 'STOP', 'sbc_init : OASIS-coupled atmosphere model, but key_oasis3 disabled' ) 
    175       IF( ln_mixcpl .AND. .NOT. lk_oasis )    & 
    176          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires the cpp key key_oasis3' ) 
    177       IF( ln_mixcpl .AND. .NOT. ln_cpl )    & 
    178          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) requires ln_cpl = T' ) 
    179       IF( ln_mixcpl .AND. nn_components /= jp_iam_nemo )    & 
    180          &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl) is not yet working with sas-opa coupling via oasis' ) 
     176      IF( ( ln_mixcpl .OR. ln_wavcpl ) .AND. .NOT. lk_oasis )    & 
     177         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl or ln_wavcpl) requires the cpp key key_oasis3' ) 
     178      IF( ( ln_mixcpl .OR. ln_wavcpl ) .AND. .NOT. ln_cpl )    & 
     179         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl or ln_wavcpl) requires ln_cpl = T' ) 
     180      IF( ( ln_mixcpl .OR. ln_wavcpl ) .AND. nn_components /= jp_iam_nemo )    & 
     181         &      CALL ctl_stop( 'the forced-coupled mixed mode (ln_mixcpl or ln_wavcpl) is not yet working with sas-opa coupling via oasis' ) 
    181182 
    182183      !                              ! allocate sbc arrays 
     
    239240      ENDIF  
    240241      !                          ! Choice of the Surface Boudary Condition (set nsbc) 
    241       ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl 
     242      ll_purecpl = ln_cpl .AND. .NOT. ln_mixcpl .AND. .NOT. ln_wavcpl 
    242243      ! 
    243244      icpt = 0 
     
    271272         IF( nsbc == jp_mfs     )   WRITE(numout,*) '              MFS Bulk formulation' 
    272273         IF( nsbc == jp_none    )   WRITE(numout,*) '              OPA coupled to SAS via oasis' 
    273          IF( ln_mixcpl          )   WRITE(numout,*) '              + forced-coupled mixed formulation' 
     274         IF( ln_mixcpl          )   WRITE(numout,*) '              + forced-coupled mixed atm formulation' 
     275         IF( ln_wavcpl          )   WRITE(numout,*) '              + forced-coupled mixed wav formulation' 
    274276         IF( nn_components/= jp_iam_nemo )  & 
    275277            &                       WRITE(numout,*) '              + OASIS coupled SAS' 
     
    395397      END SELECT 
    396398 
    397       IF( ln_mixcpl )        CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
     399      IF( ln_mixcpl .OR. ln_wavcpl )  CALL sbc_cpl_rcv ( kt, nn_fsbc, nn_ice )   ! forced-coupled mixed formulation after forcing 
    398400 
    399401      IF ( ln_wave .AND. ln_tauoc) THEN                 ! Wave stress subctracted  
Note: See TracChangeset for help on using the changeset viewer.