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 13463 for NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/TOP/PISCES/SED/sedini.F90 – NEMO

Ignore:
Timestamp:
2020-09-14T17:40:34+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2195:update to trunk 13461

Location:
NEMO/branches/2019/dev_r11351_fldread_with_XIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@13382        sette 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/TOP/PISCES/SED/sedini.F90

    r10362 r13463  
    1313   USE sedarr 
    1414   USE sedadv 
    15    USE trc_oce, ONLY : nn_dttrc 
    1615   USE trcdmp_sed 
    1716   USE trcdta 
     
    2322   PRIVATE 
    2423 
     24   !! * Substitutions 
     25#  include "do_loop_substitute.h90" 
    2526   !! Module variables 
    2627   REAL(wp)    ::  & 
     
    134135      ! Determination of sediments number of points and allocate global variables 
    135136      epkbot(:,:) = 0. 
    136       DO jj = 1, jpj 
    137          DO ji = 1, jpi 
    138             ikt = mbkt(ji,jj)  
    139             IF( tmask(ji,jj,ikt) == 1 ) epkbot(ji,jj) = e3t_1d(ikt) 
    140             gdepbot(ji,jj) = gdepw_0(ji,jj,ikt) 
    141          ENDDO 
    142       ENDDO 
     137      DO_2D( 1, 1, 1, 1 ) 
     138         ikt = mbkt(ji,jj)  
     139         IF( tmask(ji,jj,ikt) == 1 ) epkbot(ji,jj) = e3t_1d(ikt) 
     140         gdepbot(ji,jj) = gdepw_0(ji,jj,ikt) 
     141      END_2D 
    143142 
    144143      ! computation of total number of ocean points 
     
    248247      ! Computation of 1D array of sediments points 
    249248      indoce = 0 
    250       DO jj = 1, jpj 
    251          DO ji = 1, jpi 
    252             IF (  epkbot(ji,jj) > 0. ) THEN 
    253                indoce          = indoce + 1 
    254                iarroce(indoce) = (jj - 1) * jpi + ji 
    255             ENDIF 
    256          END DO 
    257       END DO 
     249      DO_2D( 1, 1, 1, 1 ) 
     250         IF (  epkbot(ji,jj) > 0. ) THEN 
     251            indoce          = indoce + 1 
     252            iarroce(indoce) = (jj - 1) * jpi + ji 
     253         ENDIF 
     254      END_2D 
    258255 
    259256      IF ( indoce .EQ. 0 ) THEN 
     
    406403      !!---------------------------------------------------------------------- 
    407404 
    408       INTEGER ::   numnamsed_ref = -1           !! Logical units for namelist sediment 
    409       INTEGER ::   numnamsed_cfg = -1           !! Logical units for namelist sediment 
     405      CHARACTER(:), ALLOCATABLE ::   numnamsed_ref           !! Character buffer for reference namelist sediment 
     406      CHARACTER(:), ALLOCATABLE ::   numnamsed_cfg           !! Character buffer for configuration namelist sediment 
    410407      INTEGER :: ios                 ! Local integer output status for namelist read 
    411408      CHARACTER(LEN=20)   ::   clname 
     
    452449      IF(lwp) WRITE(numsed,*) ' sed_init_nam : read SEDIMENT namelist' 
    453450      IF(lwp) WRITE(numsed,*) ' ~~~~~~~~~~~~~~' 
    454       CALL ctl_opn( numnamsed_ref, TRIM( clname )//'_ref', 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    455       CALL ctl_opn( numnamsed_cfg, TRIM( clname )//'_cfg', 'OLD'    , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     451      CALL load_nml( numnamsed_ref, TRIM( clname )//'_ref', numout, lwm ) 
     452      CALL load_nml( numnamsed_cfg, TRIM( clname )//'_cfg', numout, lwm ) 
    456453 
    457454      nitsed000 = nittrc000 
    458455      nitsedend = nitend 
    459456      ! Namelist nam_run 
    460       REWIND( numnamsed_ref )              ! Namelist nam_run in reference namelist : Pisces variables 
    461457      READ  ( numnamsed_ref, nam_run, IOSTAT = ios, ERR = 901) 
    462 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_run in reference namelist', lwp ) 
    463  
    464       REWIND( numnamsed_cfg )              ! Namelist nam_run in reference namelist : Pisces variables 
     458901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_run in reference namelist' ) 
     459 
    465460      READ  ( numnamsed_cfg, nam_run, IOSTAT = ios, ERR = 902) 
    466 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_run in configuration namelist', lwp ) 
     461902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_run in configuration namelist' ) 
    467462 
    468463      IF (lwp) THEN 
     
    474469      IF ( ln_p5z .AND. ln_sed_2way ) CALL ctl_stop( '2 ways coupling with sediment cannot be activated with PISCES-QUOTA' ) 
    475470 
    476       REWIND( numnamsed_ref )              ! Namelist nam_geom in reference namelist : Pisces variables 
    477471      READ  ( numnamsed_ref, nam_geom, IOSTAT = ios, ERR = 903) 
    478 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_geom in reference namelist', lwp ) 
    479  
    480       REWIND( numnamsed_cfg )              ! Namelist nam_geom in reference namelist : Pisces variables 
     472903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_geom in reference namelist' ) 
     473 
    481474      READ  ( numnamsed_cfg, nam_geom, IOSTAT = ios, ERR = 904) 
    482 904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_geom in configuration namelist', lwp ) 
     475904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_geom in configuration namelist' ) 
    483476 
    484477      IF (lwp) THEN  
     
    495488 
    496489      jpksedm1  = jpksed - 1 
    497       dtsed = r2dttrc 
    498  
    499       REWIND( numnamsed_ref )              ! Namelist nam_trased in reference namelist : Pisces variables 
     490      dtsed = rDt_trc 
     491 
    500492      READ  ( numnamsed_ref, nam_trased, IOSTAT = ios, ERR = 905) 
    501 905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_trased in reference namelist', lwp ) 
    502  
    503       REWIND( numnamsed_cfg )              ! Namelist nam_trased in reference namelist : Pisces variables 
     493905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_trased in reference namelist' ) 
     494 
    504495      READ  ( numnamsed_cfg, nam_trased, IOSTAT = ios, ERR = 906) 
    505 906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_trased in configuration namelist', lwp ) 
     496906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_trased in configuration namelist' ) 
    506497 
    507498      DO jn = 1, jpsol 
     
    530521      ENDIF 
    531522 
    532       REWIND( numnamsed_ref )              ! Namelist nam_diased in reference namelist : Pisces variables 
    533523      READ  ( numnamsed_ref, nam_diased, IOSTAT = ios, ERR = 907) 
    534 907   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diased in reference namelist', lwp ) 
    535  
    536       REWIND( numnamsed_cfg )              ! Namelist nam_diased in reference namelist : Pisces variables 
     524907   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diased in reference namelist' ) 
     525 
    537526      READ  ( numnamsed_cfg, nam_diased, IOSTAT = ios, ERR = 908) 
    538 908   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diased in configuration namelist', lwp ) 
     527908   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diased in configuration namelist' ) 
    539528       
    540529      DO jn = 1, jpdia3dsed 
     
    572561      ! Inorganic chemistry parameters 
    573562      !---------------------------------- 
    574       REWIND( numnamsed_ref )              ! Namelist nam_inorg in reference namelist : Pisces variables 
    575563      READ  ( numnamsed_ref, nam_inorg, IOSTAT = ios, ERR = 909) 
    576 909   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_inorg in reference namelist', lwp ) 
    577  
    578       REWIND( numnamsed_cfg )              ! Namelist nam_inorg in reference namelist : Pisces variables 
     564909   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_inorg in reference namelist' ) 
     565 
    579566      READ  ( numnamsed_cfg, nam_inorg, IOSTAT = ios, ERR = 910) 
    580 910   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_inorg in configuration namelist', lwp ) 
     567910   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_inorg in configuration namelist' ) 
    581568 
    582569      IF (lwp) THEN 
     
    598585      ! Additional parameter linked to POC/O2/No3/Po4 
    599586      !---------------------------------------------- 
    600       REWIND( numnamsed_ref )              ! Namelist nam_poc in reference namelist : Pisces variables 
    601587      READ  ( numnamsed_ref, nam_poc, IOSTAT = ios, ERR = 911) 
    602 911   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_poc in reference namelist', lwp ) 
    603  
    604       REWIND( numnamsed_cfg )              ! Namelist nam_poc in reference namelist : Pisces variables 
     588911   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_poc in reference namelist' ) 
     589 
    605590      READ  ( numnamsed_cfg, nam_poc, IOSTAT = ios, ERR = 912) 
    606 912   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_poc in configuration namelist', lwp ) 
     591912   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_poc in configuration namelist' ) 
    607592 
    608593      IF (lwp) THEN 
     
    650635      ! Bioturbation parameter 
    651636      !------------------------ 
    652       REWIND( numnamsed_ref )              ! Namelist nam_btb in reference namelist : Pisces variables 
    653637      READ  ( numnamsed_ref, nam_btb, IOSTAT = ios, ERR = 913) 
    654 913   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_btb in reference namelist', lwp ) 
    655  
    656       REWIND( numnamsed_cfg )              ! Namelist nam_btb in reference namelist : Pisces variables 
     638913   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_btb in reference namelist' ) 
     639 
    657640      READ  ( numnamsed_cfg, nam_btb, IOSTAT = ios, ERR = 914) 
    658 914   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_btb in configuration namelist', lwp ) 
     641914   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_btb in configuration namelist' ) 
    659642 
    660643      IF (lwp) THEN 
     
    671654      ! Initial value (t=0) for sediment pore water and solid components 
    672655      !---------------------------------------------------------------- 
    673       REWIND( numnamsed_ref )              ! Namelist nam_rst in reference namelist : Pisces variables 
    674656      READ  ( numnamsed_ref, nam_rst, IOSTAT = ios, ERR = 915) 
    675 915   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_rst in reference namelist', lwp ) 
    676  
    677       REWIND( numnamsed_cfg )              ! Namelist nam_rst in reference namelist : Pisces variables 
     657915   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_rst in reference namelist' ) 
     658 
    678659      READ  ( numnamsed_cfg, nam_rst, IOSTAT = ios, ERR = 916) 
    679 916   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_rst in configuration namelist', lwp ) 
     660916   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_rst in configuration namelist' ) 
    680661 
    681662      IF (lwp) THEN 
     
    684665         WRITE(numsed,*) ' ' 
    685666      ENDIF 
    686       nn_dtsed = nn_dttrc 
    687  
    688       CLOSE( numnamsed_cfg ) 
    689       CLOSE( numnamsed_ref ) 
     667      nn_dtsed = 1 
     668 
    690669 
    691670   END SUBROUTINE sed_init_nam 
Note: See TracChangeset for help on using the changeset viewer.