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 1133 for trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90 – NEMO

Ignore:
Timestamp:
2008-06-24T17:41:07+02:00 (16 years ago)
Author:
smasson
Message:

new sbc namelist format, see ticket:1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r1116 r1133  
    116116      !                                   !   Namelist 
    117117      !                                   ! ============ 
    118       !                                         ! Default values NB: frequency>0 hours, <0 months) 
    119       !            !   file    ! frequency !  variable  ! time intep !  clim  ! starting ! 
    120       !            !   name    !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  ! 
    121       sn_rnf = FLD_N( 'runoffs',   -12.    , 'sorunoff' ,  .TRUE.    ,    1   ,     0    ) 
    122       sn_cnf = FLD_N( 'runoffs',     0.    , 'sorunoff' ,  .FALSE.   ,    1   ,     0    ) 
     118      ! (NB: frequency positive => hours, negative => months) 
     119      !            !   file    ! frequency !  variable  ! time intep !  clim  ! 'yearly' or ! 
     120      !            !   name    !  (hours)  !   name     !   (T/F)    !  (T/F) !  'monthly'  ! 
     121      sn_rnf = FLD_N( 'runoffs',    -1.    , 'sorunoff' ,  .TRUE.    , .true. ,   'yearly'  ) 
     122      sn_cnf = FLD_N( 'runoffs',     0.    , 'sorunoff' ,  .FALSE.   , .true. ,   'yearly'  ) 
    123123 
    124124      ! 
     
    152152            CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN 
    153153         ENDIF 
    154          !                                         ! namelist informations stored in sf_rnf structures 
    155          WRITE( sf_rnf(1)%clrootname, '(a,a)' )   TRIM( cn_dir ), TRIM( sn_rnf%clname ) 
    156          sf_rnf(1)%freqh   = sn_rnf%freqh 
    157          sf_rnf(1)%clvar   = sn_rnf%clvar 
    158          sf_rnf(1)%ln_tint = sn_rnf%ln_tint 
    159          sf_rnf(1)%nclim   = sn_rnf%nclim 
    160          sf_rnf(1)%nstrec  = sn_rnf%nstrec 
    161          IF(lwp) THEN                              ! control print 
    162             WRITE(numout,*) '   Runoffs data read in the following file: ' 
    163             WRITE(numout,*) '               root filename: '  , trim( sf_rnf(1)%clrootname ),   & 
    164                &                          ' variable name: '  , trim( sf_rnf(1)%clvar      ) 
    165             WRITE(numout,*) '               frequency: '      ,       sf_rnf(1)%freqh       ,   & 
    166                &                          ' time interp: '    ,       sf_rnf(1)%ln_tint     ,   & 
    167                &                          ' climatology: '    ,       sf_rnf(1)%nclim       ,   & 
    168                &                          ' starting record: ',       sf_rnf(1)%nstrec 
    169          ENDIF 
     154 
     155         ! fill sf_rnf with sn_rnf and control print 
     156         CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf' ) 
    170157         ! 
    171158      ENDIF 
     
    238225      IF(lwp) WRITE(numout,*) '~~~~~~~~~ ' 
    239226 
    240       WRITE(cl_rnfile, '(a,a)')   TRIM( cn_dir ), TRIM( sn_cnf%clname ) 
    241       SELECT CASE( sn_cnf%nclim ) 
    242       CASE( 0 ) 
    243          WRITE(cl_rnfile, '(a,a,"_",i4,".nc")' ) TRIM( cn_dir ), TRIM( sn_cnf%clname ), nyear 
    244       CASE( 1 ) 
    245          WRITE(cl_rnfile, '(a,a,  ".nc")' ) TRIM( cn_dir ), TRIM( sn_cnf%clname ) 
    246       END SELECT 
    247  
     227      cl_rnfile = TRIM( cn_dir )//TRIM( sn_cnf%clname ) 
     228      IF( .NOT. sn_cnf%ln_clim ) THEN   ;   WRITE(cl_rnfile, '(a,"_y",i4)' ) TRIM( cl_rnfile ), nyear    ! add year 
     229         IF( sn_cnf%cltype == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month 
     230      ENDIF 
     231   
    248232      ! horizontal mask (read in NetCDF file) 
    249233      CALL iom_open ( cl_rnfile, inum )                           ! open file 
Note: See TracChangeset for help on using the changeset viewer.