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 12803 for NEMO – NEMO

Changeset 12803 for NEMO


Ignore:
Timestamp:
2020-04-23T10:57:49+02:00 (4 years ago)
Author:
dancopsey
Message:

Merge in NEMO_4.0.1_GC_couple_pkg

Location:
NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch/cfgs/SHARED/namelist_ref

    r12801 r12803  
    335335   sn_rcv_tauwoc =   'none'                 ,    'no'    ,     ''      ,         ''          ,   '' 
    336336   sn_rcv_tauw   =   'none'                 ,    'no'    ,     ''      ,         ''          ,   '' 
    337    sn_rcv_wdrag  =   'none'                 ,    'no'    ,     ''      ,         ''          ,   '' 
    338337/ 
    339338!----------------------------------------------------------------------- 
  • NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch/src/OCE/LBC/lib_mpp.F90

    r12801 r12803  
    666666 
    667667   SUBROUTINE mppstop( ld_abort )  
     668 
     669      USE mod_oasis      ! coupling routines 
     670 
    668671      !!---------------------------------------------------------------------- 
    669672      !!                  ***  routine mppstop  *** 
     
    679682      IF( PRESENT(ld_abort) ) ll_abort = ld_abort 
    680683      ! 
     684 
     685#if defined key_oasis3 
     686      ! If we're trying to shut down cleanly then we need to consider the fact 
     687      ! that this could be part of an MPMD configuration - we don't want to 
     688      ! leave other components deadlocked. 
     689 
     690      CALL oasis_abort(nproc,"mppstop","NEMO initiated abort") 
     691 
     692 
     693#else 
    681694#if defined key_mpp_mpi 
    682695      IF(ll_abort) THEN 
     
    689702      IF( ll_abort ) STOP 123 
    690703      ! 
     704#endif 
    691705   END SUBROUTINE mppstop 
    692706 
  • NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch/src/OCE/SBC/cpl_oasis3.F90

    r12801 r12803  
    4242   PUBLIC   cpl_freq 
    4343   PUBLIC   cpl_finalize 
     44    
    4445 
    4546   INTEGER, PUBLIC            ::   OASIS_Rcv  = 1    !: return code if received field 
     
    8687 
    8788   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   exfld   ! Temporary buffer for receiving 
    88  
     89       
    8990   !!---------------------------------------------------------------------- 
    9091   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    448449                     WRITE(numout,*) '     -     Sum value is ',    SUM(pdata(nldi:nlei,nldj:nlej,jc)) 
    449450                     WRITE(numout,*) '****************' 
     451                     CALL FLUSH(numout) 
    450452                  ENDIF 
    451453                   
     
    519521         CALL oasis_get_freqs(id,      1, itmp, info) 
    520522#endif 
    521          cpl_freq = itmp(1) 
     523         cpl_freq = itmp(1)  
    522524      ENDIF 
    523525      ! 
  • NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch/src/OCE/SBC/geo2ocean.F90

    r12801 r12803  
    2626   PRIVATE 
    2727 
     28   PUBLIC   repcmo    ! called in sbccpl 
    2829   PUBLIC   rot_rep   ! called in sbccpl, fldread, and cyclone 
    2930   PUBLIC   geo2oce   ! called in sbccpl 
     
    5051   !!---------------------------------------------------------------------- 
    5152CONTAINS 
     53 
     54   SUBROUTINE repcmo ( pxu1, pyu1, pxv1, pyv1,   & 
     55                       px2 , py2 , kchoix  ) 
     56      !!---------------------------------------------------------------------- 
     57      !!                  ***  ROUTINE repcmo  *** 
     58      !! 
     59      !! ** Purpose :   Change vector componantes from a geographic grid to a 
     60      !!      stretched coordinates grid. 
     61      !! 
     62      !! ** Method  :   Initialization of arrays at the first call. 
     63      !! 
     64      !! ** Action  : - px2 : first  componante (defined at u point) 
     65      !!              - py2 : second componante (defined at v point) 
     66      !!---------------------------------------------------------------------- 
     67      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pxu1, pyu1   ! geographic vector componantes at u-point 
     68      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pxv1, pyv1   ! geographic vector componantes at v-point 
     69      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   px2          ! i-componante (defined at u-point) 
     70      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   py2          ! j-componante (defined at v-point) 
     71      !!---------------------------------------------------------------------- 
     72      INTEGER, INTENT( IN ) ::   & 
     73         kchoix   ! type of transformation 
     74                  ! = 1 change from geographic to model grid. 
     75                  ! =-1 change from model to geographic grid 
     76      !!---------------------------------------------------------------------- 
     77  
     78      SELECT CASE (kchoix) 
     79      CASE ( 1) 
     80        ! Change from geographic to stretched coordinate 
     81        ! ---------------------------------------------- 
     82      
     83        CALL rot_rep( pxu1, pyu1, 'U', 'en->i',px2 ) 
     84        CALL rot_rep( pxv1, pyv1, 'V', 'en->j',py2 ) 
     85      CASE (-1) 
     86       ! Change from stretched to geographic coordinate 
     87       ! ---------------------------------------------- 
     88      
     89       CALL rot_rep( pxu1, pyu1, 'U', 'ij->e',px2 ) 
     90       CALL rot_rep( pxv1, pyv1, 'V', 'ij->n',py2 ) 
     91     END SELECT 
     92      
     93   END SUBROUTINE repcmo 
    5294 
    5395   SUBROUTINE rot_rep ( pxin, pyin, cd_type, cdtodo, prot ) 
  • NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch/src/OCE/SBC/sbccpl.F90

    r12801 r12803  
    412412         srcv(jpr_otx2:jpr_otz2)%clgrid  = 'V'        !           and           V-point 
    413413         srcv(jpr_itx1:jpr_itz1)%clgrid  = 'F'        ! ice components given at F-point 
    414          srcv(jpr_otx1:jpr_otz2)%laction = .TRUE.     ! receive oce components on grid 1 & 2 
     414         !srcv(jpr_otx1:jpr_otz2)%laction = .TRUE.     ! receive oce components on grid 1 & 2 
     415! Currently needed for HadGEM3 - but shouldn't affect anyone else for the moment 
     416         srcv(jpr_otx1)%laction = .TRUE.  
     417         srcv(jpr_oty1)%laction = .TRUE. 
     418! 
    415419         srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1 only 
    416420      CASE( 'T,I' )  
     
    11211125      LOGICAL  ::   llnewtx, llnewtau      ! update wind stress components and module?? 
    11221126      INTEGER  ::   ji, jj, jn             ! dummy loop indices 
    1123       INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdt did not change since nit000) 
     1127      INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdttra did not change since nit000) 
     1128      INTEGER  ::   ikchoix 
    11241129      REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars      
    11251130      REAL(wp) ::   zcoef                  ! temporary scalar 
     
    11271132      REAL(wp) ::   zcdrag = 1.5e-3        ! drag coefficient 
    11281133      REAL(wp) ::   zzx, zzy               ! temporary variables 
    1129       REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty, zmsk, zemp, zqns, zqsr 
     1134      REAL(wp), DIMENSION(jpi,jpj) ::   ztx, zty, zmsk, zemp, zqns, zqsr, ztx2, zty2 
    11301135      !!---------------------------------------------------------------------- 
    11311136      ! 
     
    11741179            IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid 
    11751180               !                                                       ! (geographical to local grid -> rotate the components) 
    1176                CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )    
    1177                IF( srcv(jpr_otx2)%laction ) THEN 
    1178                   CALL rot_rep( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), srcv(jpr_otx2)%clgrid, 'en->j', zty )    
    1179                ELSE 
    1180                   CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )   
     1181               IF( srcv(jpr_otx1)%clgrid == 'U' .AND. (.NOT. srcv(jpr_otx2)%laction) ) THEN 
     1182                  ! Temporary code for HadGEM3 - will be removed eventually. 
     1183        ! Only applies when we have only taux on U grid and tauy on V grid 
     1184             DO jj=2,jpjm1 
     1185                DO ji=2,jpim1 
     1186                     ztx(ji,jj)=0.25*vmask(ji,jj,1)                & 
     1187                        *(frcv(jpr_otx1)%z3(ji,jj,1)+frcv(jpr_otx1)%z3(ji-1,jj,1)    & 
     1188                        +frcv(jpr_otx1)%z3(ji,jj+1,1)+frcv(jpr_otx1)%z3(ji-1,jj+1,1)) 
     1189                     zty(ji,jj)=0.25*umask(ji,jj,1)                & 
     1190                        *(frcv(jpr_oty1)%z3(ji,jj,1)+frcv(jpr_oty1)%z3(ji+1,jj,1)    & 
     1191                        +frcv(jpr_oty1)%z3(ji,jj-1,1)+frcv(jpr_oty1)%z3(ji+1,jj-1,1)) 
     1192                ENDDO 
     1193             ENDDO 
     1194                    
     1195             ikchoix = 1 
     1196             CALL repcmo (frcv(jpr_otx1)%z3(:,:,1),zty,ztx,frcv(jpr_oty1)%z3(:,:,1),ztx2,zty2,ikchoix) 
     1197             CALL lbc_lnk ('jpr_otx1', ztx2,'U', -1. ) 
     1198             CALL lbc_lnk ('jpr_oty1', zty2,'V', -1. ) 
     1199             frcv(jpr_otx1)%z3(:,:,1)=ztx2(:,:) 
     1200             frcv(jpr_oty1)%z3(:,:,1)=zty2(:,:) 
     1201          ELSE 
     1202             CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )    
     1203             frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
     1204             IF( srcv(jpr_otx2)%laction ) THEN 
     1205                CALL rot_rep( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), srcv(jpr_otx2)%clgrid, 'en->j', zty )    
     1206             ELSE 
     1207                CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )  
     1208             ENDIF 
     1209          frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid   
    11811210               ENDIF 
    1182                frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid 
    1183                frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid 
    11841211            ENDIF 
    11851212            !                               
     
    21772204      ! 
    21782205      INTEGER ::   ji, jj, jl   ! dummy loop indices 
     2206      INTEGER ::   ikchoix 
    21792207      INTEGER ::   isec, info   ! local integer 
    21802208      REAL(wp) ::   zumax, zvmax 
     
    24532481         !                                                  j+1   j     -----V---F 
    24542482         ! surface velocity always sent from T point                     !       | 
    2455          !                                                        j      |   T   U 
     2483         ! [except for HadGEM3]                                   j      |   T   U 
    24562484         !                                                               |       | 
    24572485         !                                                   j    j-1   -I-------| 
     
    24652493            SELECT CASE( TRIM( sn_snd_crt%cldes ) ) 
    24662494            CASE( 'oce only'             )      ! C-grid ==> T 
    2467                DO jj = 2, jpjm1 
    2468                   DO ji = fs_2, fs_jpim1   ! vector opt. 
    2469                      zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj  ,1) ) 
    2470                      zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji  ,jj-1,1) )  
     2495               IF ( TRIM( sn_snd_crt%clvgrd ) == 'T' ) THEN 
     2496                  DO jj = 2, jpjm1 
     2497                     DO ji = fs_2, fs_jpim1   ! vector opt. 
     2498                        zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj  ,1) ) 
     2499                        zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji  ,jj-1,1) )  
     2500                     END DO 
    24712501                  END DO 
    2472                END DO 
     2502               ELSE 
     2503! Temporarily Changed for UKV 
     2504                  DO jj = 2, jpjm1 
     2505                     DO ji = 2, jpim1 
     2506                        zotx1(ji,jj) = un(ji,jj,1) 
     2507                        zoty1(ji,jj) = vn(ji,jj,1) 
     2508                     END DO 
     2509                  END DO 
     2510               ENDIF 
    24732511            CASE( 'weighted oce and ice' )      ! Ocean and Ice on C-grid ==> T   
    24742512               DO jj = 2, jpjm1 
     
    24982536         IF( TRIM( sn_snd_crt%clvor ) == 'eastward-northward' ) THEN             ! Rotation of the components 
    24992537            !                                                                     ! Ocean component 
    2500             CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component  
    2501             CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->n', ztmp2 )       ! 2nd component  
    2502             zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components  
    2503             zoty1(:,:) = ztmp2(:,:) 
    2504             IF( ssnd(jps_ivx1)%laction ) THEN                                     ! Ice component 
    2505                CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component  
    2506                CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component  
    2507                zitx1(:,:) = ztmp1(:,:)                                                ! overwrite the components  
    2508                zity1(:,:) = ztmp2(:,:) 
    2509             ENDIF 
     2538            IF ( TRIM( sn_snd_crt%clvgrd ) == 'T' ) THEN 
     2539               CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component 
     2540               CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->n', ztmp2 )       ! 2nd component 
     2541               zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components 
     2542               zoty1(:,:) = ztmp2(:,:) 
     2543               IF( ssnd(jps_ivx1)%laction ) THEN                                  ! Ice component 
     2544                  CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component 
     2545                  CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component 
     2546                  zitx1(:,:) = ztmp1(:,:)                                                ! overwrite the components 
     2547                  zity1(:,:) = ztmp2(:,:) 
     2548               ENDIF 
     2549            ELSE 
     2550               ! Temporary code for HadGEM3 - will be removed eventually. 
     2551               ! Only applies when we want uvel on U grid and vvel on V grid 
     2552               ! Rotate U and V onto geographic grid before sending. 
     2553 
     2554               DO jj=2,jpjm1 
     2555                  DO ji=2,jpim1 
     2556                     ztmp1(ji,jj)=0.25*vmask(ji,jj,1)                  & 
     2557                          *(zotx1(ji,jj)+zotx1(ji-1,jj)    & 
     2558                          +zotx1(ji,jj+1)+zotx1(ji-1,jj+1)) 
     2559                     ztmp2(ji,jj)=0.25*umask(ji,jj,1)                  & 
     2560                          *(zoty1(ji,jj)+zoty1(ji+1,jj)    & 
     2561                          +zoty1(ji,jj-1)+zoty1(ji+1,jj-1)) 
     2562                  ENDDO 
     2563               ENDDO 
     2564                
     2565               ! Ensure any N fold and wrap columns are updated 
     2566               CALL lbc_lnk('zotx1', ztmp1, 'V', -1.0) 
     2567               CALL lbc_lnk('zoty1', ztmp2, 'U', -1.0) 
     2568                
     2569               ikchoix = -1 
     2570               CALL repcmo (zotx1,ztmp2,ztmp1,zoty1,zotx1,zoty1,ikchoix) 
     2571           ENDIF 
    25102572         ENDIF 
    25112573         ! 
  • NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch/src/OCE/nemogcm.F90

    r12801 r12803  
    8787   USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges  
    8888   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
     89   USE sbccpl  
    8990#if defined key_iomput 
    9091   USE xios           ! xIOserver 
     
    199200            ENDIF 
    200201             
     202            IF (lk_oasis) THEN 
     203               CALL sbc_cpl_snd( istp )  ! Coupling to atmos 
     204            ENDIF 
    201205            CALL stp        ( istp )  
    202206            istp = istp + 1 
     
    209213         ! 
    210214         DO WHILE( istp <= nitend .AND. nstop == 0 ) 
    211             CALL stp_diurnal( istp )   ! time step only the diurnal SST  
     215            CALL stp_diurnal( istp )   ! time step only the diurnal SST 
    212216            istp = istp + 1 
    213217         END DO 
     
    279283      IF( Agrif_Root() ) THEN 
    280284         IF( lk_oasis ) THEN 
    281             CALL cpl_init( "oceanx", ilocal_comm )                               ! nemo local communicator given by oasis 
     285            CALL cpl_init( "toyoce", ilocal_comm )                     ! nemo local communicator given by oasis 
    282286            CALL xios_initialize( "not used"       , local_comm =ilocal_comm )   ! send nemo communicator to xios 
    283287         ELSE 
     
    289293      IF( lk_oasis ) THEN 
    290294         IF( Agrif_Root() ) THEN 
    291             CALL cpl_init( "oceanx", ilocal_comm )          ! nemo local communicator given by oasis 
     295            CALL cpl_init( "toyoce", ilocal_comm )                      ! nemo local communicator given by oasis 
    292296         ENDIF 
    293297         CALL mpp_start( ilocal_comm ) 
     
    498502      ! 
    499503      IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA 
     504       
     505      IF (nstop > 0) THEN 
     506        CALL CTL_STOP('STOP','Critical errors in NEMO initialisation') 
     507      END IF 
     508       
    500509      ! 
    501510      IF( ln_timing    )   CALL timing_stop( 'nemo_init') 
  • NEMO/branches/UKMO/r4.0-HEAD_r12713_dan_test_clems_branch/src/OCE/step.F90

    r12801 r12803  
    311311      ! Coupled mode 
    312312      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    313 !!gm why lk_oasis and not lk_cpl ???? 
    314       IF( lk_oasis   )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
     313      !IF( lk_oasis         )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges 
    315314      ! 
    316315#if defined key_iomput 
Note: See TracChangeset for help on using the changeset viewer.