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

Changeset 11658 for NEMO


Ignore:
Timestamp:
2019-10-07T19:55:50+02:00 (4 years ago)
Author:
mathiot
Message:

ENHANCE-03_domcfg: forced local domain to read the overlap region + re-arange the ocean output print (ticket #2143)

Location:
NEMO/branches/2019/ENHANCE-03_domcfg/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/ENHANCE-03_domcfg/src/domclo.F90

    r11628 r11658  
    156156      DO jcs = 1,nn_closea 
    157157 
    158          !! 2.2 : print out and sanity check 
    159          !! flag changed in sanity checks 
    160          lskip = .FALSE. 
    161  
    162          !! define seed to extract the closed sea jcs 
    163          CALL dom_ngb(sn_lake(jcs)%rlonsrc, sn_lake(jcs)%rlatsrc, jiseed, jjseed, zdistseed, 'T') 
    164  
    165158         !! how the excess of the closed seas is spread out: 
    166          IF (lwp) THEN 
    167             WRITE(numout,*) 
    168             WRITE(numout,'(a,a10,a,2f7.2,a)')'    processing lake ',TRIM(sn_lake(jcs)%cname)             & 
    169                  &        ,' ( lat/lon : ',sn_lake(jcs)%rlatsrc, sn_lake(jcs)%rlonsrc,' )' 
    170          END IF 
    171159         cloc = sn_lake(jcs)%cloctrg 
    172160         csch = sn_lake(jcs)%cschtrg 
    173    
    174          !! set up indexes and mask  ! SELECT CASE ... 
     161 
     162         !! set up indexes and mask 
    175163         SELECT CASE (csch) 
    176164         CASE('glo') 
     
    178166            zmsksrc(:,:) = msk_glo(:,:) 
    179167            zmsktrg(:,:) = msk_gloid(:,:) 
    180             IF (lwp) WRITE(numout,*)'        net evap/precip will be spread globally' 
    181168         CASE('rnf')  
    182169            jsch = jrnf 
    183170            zmsksrc(:,:) = msk_rnf(:,:) 
    184171            zmsktrg(:,:) = msk_rnfid(:,:) 
    185             IF (lwp) WRITE(numout,*)'        net precip will be spread locally and net evap globally' 
    186172         CASE('emp') 
    187173            jsch = jemp  
    188174            zmsksrc(:,:) = msk_emp(:,:) 
    189175            zmsktrg(:,:) = msk_empid(:,:) 
    190             IF (lwp) WRITE(numout,*)'        net precip will be spread locally' 
    191176         CASE DEFAULT 
    192             CALL ctl_stop( 'STOP', 'domclo: unknown target type for lake (should be glo, emp, rnf)' ) 
     177            CALL ctl_stop( 'STOP', 'domclo: ',TRIM(csch),' is an unknown target type for lake (should be glo, emp, rnf)' ) 
    193178         END SELECT 
     179 
     180         !! 2.2 : print out and sanity check 
     181         !! flag changed in sanity checks 
     182         lskip = .FALSE. 
     183 
     184         !! define seed to extract the closed sea jcs 
     185         CALL dom_ngb(sn_lake(jcs)%rlonsrc, sn_lake(jcs)%rlatsrc, jiseed, jjseed, zdistseed, 'T') 
    194186 
    195187         !! sanity check on the msk value (closea mask should be 99 otherwise, lake already processed) 
     
    209201            lskip = .TRUE. 
    210202         END IF 
    211  
     203  
    212204         !! 2.3 : compute mask for global, rnf, emp case 
    213205         IF (.NOT. lskip) THEN 
     206 
     207            IF (lwp) THEN 
     208               WRITE(numout,*) 
     209               WRITE(numout,'(a,a10,a,2f7.2,a,2i6,a,f7.2,a)')                               & 
     210                    &         '    processing lake ',TRIM(sn_lake(jcs)%cname)               & 
     211                    &        ,' ( lat/lon : ',sn_lake(jcs)%rlatsrc, sn_lake(jcs)%rlonsrc    & 
     212                    &        ,' , i/j     : ',jiseed,jjseed                                 & 
     213                    &        ,' , distance to seed : ',zdistseed,'m )' 
     214            END IF 
     215 
    214216            !! fill close sea mask with counter value 
    215217            CALL fill_pool( jiseed, jjseed, zmsksrc, REAL(jsch  ,8)) 
     
    248250 
    249251               !! print 
    250                IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a)')'         river mouth area is defined by         points within ',zradtrg(1)         & 
    251                              &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                                  & 
    252                              &        ,' (closest point is i/j ',jiseed, jjseed,')' 
     252               IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a,f7.0,a)')                                            & 
     253                             &         '         river mouth area is defined by         points within ',zradtrg(1) & 
     254                             &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                & 
     255                             &        ,' (closest wet point is i/j ',jiseed, jjseed,' at ',zdistseed,' m )' 
    253256            CASE ('coast') 
    254257               !! define coastline mask 
     
    265268 
    266269               !! print 
    267                IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a)')'         river mouth area is defined by coastal points within ',zradtrg(1) & 
    268                              &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                                  & 
    269                              &        ,' (closest point is i/j ',jiseed, jjseed,')' 
     270               IF (lwp) WRITE(numout,'(a,f7.0,a,2f7.2,a,2i7,a,f7.0,a)')                                            & 
     271                             &         '         river mouth area is defined by coastal points within ',zradtrg(1) & 
     272                             &        ,' m of lat/lon ', sn_lake(jcs)%rlontrg, sn_lake(jcs)%rlattrg                & 
     273                             &        ,' (closest wet point is i/j ',jiseed, jjseed,' at ',zdistseed,' m )' 
    270274 
    271275            CASE DEFAULT 
     
    277281            zarea = glob_sum('domclo',zmsktrg * msk_opnsea) 
    278282            IF (zarea == 0._wp) CALL ctl_stop( 'STOP', 'river mouth area is 0, tune lon/lat trg or radtrg for this lake')  
     283            ! 
     284            zarea = glob_sum('domclo',zmsksrc * msk_opnsea) 
     285            IF (zarea > 0._wp) CALL ctl_stop( 'STOP', 'closed seas and open ocean have common points, '                           & 
     286               &                                    , 'tune lon/lat src or check if your lake is really closed on the model grid') 
    279287 
    280288            !! set up indexes and mask  
     
    284292               msk_glo(:,:)   = zmsksrc(:,:) 
    285293               msk_gloid(:,:) = zmsktrg(:,:) 
     294               IF (lwp) WRITE(numout,*)'        net evap/precip will be spread globally (glo)' 
    286295            CASE ('rnf') 
    287296               jrnf = jrnf + 1 
    288297               msk_rnf(:,:)   = zmsksrc(:,:) 
    289298               msk_rnfid(:,:) = zmsktrg(:,:) 
     299               IF (lwp) WRITE(numout,*)'        net precip will be spread locally and net evap globally (rnf)' 
    290300            CASE ('emp') 
    291301               jemp = jemp + 1 
    292302               msk_emp(:,:)   = zmsksrc(:,:) 
    293303               msk_empid(:,:) = zmsktrg(:,:) 
     304               IF (lwp) WRITE(numout,*)'        net evap/precip will be spread locally (emp)' 
    294305            END SELECT 
    295306 
  • NEMO/branches/2019/ENHANCE-03_domcfg/src/domzgr.F90

    r11602 r11658  
    6060   REAL(wp), PUBLIC ::   e3zps_min       !: miminum thickness for partial steps (meters) 
    6161   REAL(wp), PUBLIC ::   e3zps_rat       !: minimum thickness ration for partial steps 
    62    INTEGER, PUBLIC  ::   nperio          !: type of lateral boundary condition 
    6362 
    6463   ! Song and Haidvogel 1994 stretching parameters 
     
    702701            ENDIF 
    703702         ENDIF 
    704       ELSEIF( jperio == 1 .OR. jperio == 4 .OR. jperio ==  6 ) THEN 
     703      ELSEIF( l_Iperio ) THEN 
    705704         IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions on mbathy: jperio = ', jperio 
    706705         mbathy( 1 ,:) = mbathy(jpim1,:) 
     
    11661165            mbathy(:,:)  = INT( zbathy(:,:) ) 
    11671166         ENDIF 
    1168          IF( nperio == 1 .OR. nperio  ==  4 .OR. nperio  ==  6 ) THEN  
     1167         IF( l_Iperio ) THEN  
    11691168            misfdep( 1 ,:) = misfdep(jpim1,:)            ! local domain is cyclic east-west  
    11701169            misfdep(jpi,:) = misfdep(  2  ,:)  
  • NEMO/branches/2019/ENHANCE-03_domcfg/src/iom.F90

    r11654 r11658  
    660660      ! do we read the overlap  
    661661      ! ugly patch SM+JMM+RB to overwrite global definition in some cases 
    662       llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif 
     662      !llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif 
     663      ! for domain_cfg, force to read the full domain 
     664      llnoov = .FALSE. 
    663665      ! create the file name by added, if needed, TRIM(Agrif_CFixed()) and TRIM(clsuffix) 
    664666      ! ============= 
     
    10521054         ! do we read the overlap  
    10531055         ! ugly patch SM+JMM+RB to overwrite global definition in some cases 
    1054          llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif  
     1056         !  
     1057         !llnoov = (jpni * jpnj ) == jpnij .AND. .NOT. lk_agrif  
     1058         ! for domain_cfg tools force to read the full domain 
     1059         llnoov = .FALSE. 
    10551060         ! check kcount and kstart optionals parameters... 
    10561061         IF( PRESENT(kcount) .AND. (.NOT. PRESENT(kstart)) ) CALL ctl_stop(trim(clinfo), 'kcount present needs kstart present') 
     
    12331238               ENDIF 
    12341239            ENDIF 
    1235        
     1240            WRITE(numout,*) 'istart icnt',istart, ' ', icnt  
     1241            WRITE(numout,*) ' idx i1, i2, j1, j2 ',ix1, ix2, iy1, iy2 
    12361242            CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, pv_r1d, pv_r2d, pv_r3d ) 
    12371243 
Note: See TracChangeset for help on using the changeset viewer.