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 7280 for branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90 – NEMO

Ignore:
Timestamp:
2016-11-21T11:40:00+01:00 (7 years ago)
Author:
flavoni
Message:

merge CNRS2016 with aerobulk branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90

    r6140 r7280  
    44   !! Ocean forcing:  read input field for surface boundary condition 
    55   !!===================================================================== 
    6    !! History :  2.0  !  06-2006  (S. Masson, G. Madec)  Original code 
    7    !!                 !  05-2008  (S. Alderson)  Modified for Interpolation in memory from input grid to model grid 
    8    !!                 !  10-2013  (D. Delrosso, P. Oddo)  suppression of land point prior to interpolation 
     6   !! History :  2.0  !  2006-06  (S. Masson, G. Madec)  Original code 
     7   !!            3.0  !  2008-05  (S. Alderson)  Modified for Interpolation in memory from input grid to model grid 
     8   !!            3.4  !  2013-10  (D. Delrosso, P. Oddo)  suppression of land point prior to interpolation 
    99   !!---------------------------------------------------------------------- 
    1010 
    1111   !!---------------------------------------------------------------------- 
    12    !!   fld_read      : read input fields used for the computation of the 
    13    !!                   surface boundary condition 
     12   !!   fld_read      : read input fields used for the computation of the surface boundary condition 
     13   !!   fld_init      : initialization of field read 
     14   !!   fld_rec       : determined the record(s) to be read 
     15   !!   fld_get       : read the data 
     16   !!   fld_map       : read global data from file and map onto local data using a general mapping (use for open boundaries) 
     17   !!   fld_rot       : rotate the vector fields onto the local grid direction 
     18   !!   fld_clopn     : update the data file name and close/open the files 
     19   !!   fld_fill      : fill the data structure with the associated information read in namelist 
     20   !!   wgt_list      : manage the weights used for interpolation 
     21   !!   wgt_print     : print the list of known weights 
     22   !!   fld_weight    : create a WGT structure and fill in data from file, restructuring as required 
     23   !!   apply_seaoverland : fill land with ocean values 
     24   !!   seaoverland   : create shifted matrices for seaoverland application 
     25   !!   fld_interp    : apply weights to input gridded data to create data on model grid 
     26   !!   ksec_week     : function returning the first 3 letters of the first day of the weekly file 
    1427   !!---------------------------------------------------------------------- 
    1528   USE oce            ! ocean dynamics and tracers 
     
    274287            IF( sd(jf)%ln_tint ) THEN              ! temporal interpolation 
    275288               IF(lwp .AND. kt - nit000 <= 100 ) THEN  
    276                   clfmt = "('fld_read: var ', a, ' kt = ', i8, ' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   & 
     289                  clfmt = "('   fld_read: var ', a, ' kt = ', i8, ' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   & 
    277290                     &    "', records b/a: ', i6.4, '/', i6.4, ' (days ', f9.4,'/', f9.4, ')')" 
    278291                  WRITE(numout, clfmt)  TRIM( sd(jf)%clvar ), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,   &             
    279292                     & sd(jf)%nrec_b(1), sd(jf)%nrec_a(1), REAL(sd(jf)%nrec_b(2),wp)/rday, REAL(sd(jf)%nrec_a(2),wp)/rday 
    280                   WRITE(numout, *) 'it_offset is : ',it_offset 
     293                  WRITE(numout, *) '      it_offset is : ',it_offset 
    281294               ENDIF 
    282295               ! temporal interpolation weights 
     
    286299            ELSE   ! nothing to do... 
    287300               IF(lwp .AND. kt - nit000 <= 100 ) THEN 
    288                   clfmt = "('fld_read: var ', a, ' kt = ', i8,' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   & 
     301                  clfmt = "('   fld_read: var ', a, ' kt = ', i8,' (', f9.4,' days), Y/M/D = ', i4.4,'/', i2.2,'/', i2.2," //   & 
    289302                     &    "', record: ', i6.4, ' (days ', f9.4, ' <-> ', f9.4, ')')" 
    290303                  WRITE(numout, clfmt) TRIM(sd(jf)%clvar), kt, REAL(isecsbc,wp)/rday, nyear, nmonth, nday,    & 
     
    407420         CALL fld_get( sdjf, map )         ! read before data in after arrays(as we will swap it later) 
    408421         ! 
    409          clfmt = "('fld_init : time-interpolation for ', a, ' read previous record = ', i6, ' at time = ', f7.2, ' days')" 
     422         clfmt = "('   fld_init : time-interpolation for ', a, ' read previous record = ', i6, ' at time = ', f7.2, ' days')" 
    410423         IF(lwp) WRITE(numout, clfmt) TRIM(sdjf%clvar), sdjf%nrec_a(1), REAL(sdjf%nrec_a(2),wp)/rday 
    411424         ! 
     
    791804      !!                    ***  ROUTINE fld_clopn  *** 
    792805      !! 
    793       !! ** Purpose :   update the file name and open the file 
     806      !! ** Purpose :   update the file name and close/open the files 
    794807      !!---------------------------------------------------------------------- 
    795808      TYPE(FLD)        , INTENT(inout) ::   sdjf     ! input field related variables 
     
    882895 
    883896 
    884    SUBROUTINE fld_fill( sdf, sdf_n, cdir, cdcaller, cdtitle, cdnam ) 
     897   SUBROUTINE fld_fill( sdf, sdf_n, cdir, cdcaller, cdtitle, cdnam, knoprint ) 
    885898      !!--------------------------------------------------------------------- 
    886899      !!                    ***  ROUTINE fld_fill  *** 
    887900      !! 
    888       !! ** Purpose :   fill sdf with sdf_n and control print 
    889       !!---------------------------------------------------------------------- 
    890       TYPE(FLD)  , DIMENSION(:), INTENT(inout) ::   sdf        ! structure of input fields (file informations, fields read) 
    891       TYPE(FLD_N), DIMENSION(:), INTENT(in   ) ::   sdf_n      ! array of namelist information structures 
    892       CHARACTER(len=*)         , INTENT(in   ) ::   cdir       ! Root directory for location of flx files 
    893       CHARACTER(len=*)         , INTENT(in   ) ::   cdcaller   !  
    894       CHARACTER(len=*)         , INTENT(in   ) ::   cdtitle    !  
    895       CHARACTER(len=*)         , INTENT(in   ) ::   cdnam      !  
    896       ! 
    897       INTEGER  ::   jf       ! dummy indices 
     901      !! ** Purpose :   fill the data structure (sdf) with the associated information  
     902      !!              read in namelist (sdf_n) and control print 
     903      !!---------------------------------------------------------------------- 
     904      TYPE(FLD)  , DIMENSION(:)          , INTENT(inout) ::   sdf        ! structure of input fields (file informations, fields read) 
     905      TYPE(FLD_N), DIMENSION(:)          , INTENT(in   ) ::   sdf_n      ! array of namelist information structures 
     906      CHARACTER(len=*)                   , INTENT(in   ) ::   cdir       ! Root directory for location of flx files 
     907      CHARACTER(len=*)                   , INTENT(in   ) ::   cdcaller   ! name of the calling routine 
     908      CHARACTER(len=*)                   , INTENT(in   ) ::   cdtitle    ! description of the calling routine  
     909      CHARACTER(len=*)                   , INTENT(in   ) ::   cdnam      ! name of the namelist from which sdf_n comes 
     910      INTEGER                  , OPTIONAL, INTENT(in   ) ::   knoprint   ! no calling routine information printed 
     911      ! 
     912      INTEGER  ::   jf   ! dummy indices 
    898913      !!--------------------------------------------------------------------- 
    899914      ! 
     
    922937      IF(lwp) THEN      ! control print 
    923938         WRITE(numout,*) 
    924          WRITE(numout,*) TRIM( cdcaller )//' : '//TRIM( cdtitle ) 
    925          WRITE(numout,*) (/ ('~', jf = 1, LEN_TRIM( cdcaller ) ) /) 
    926          WRITE(numout,*) '          '//TRIM( cdnam )//' Namelist' 
    927          WRITE(numout,*) '          list of files and frequency (>0: in hours ; <0 in months)' 
     939         IF( .NOT.PRESENT( knoprint) ) THEN 
     940            WRITE(numout,*) TRIM( cdcaller )//' : '//TRIM( cdtitle ) 
     941            WRITE(numout,*) (/ ('~', jf = 1, LEN_TRIM( cdcaller ) ) /) 
     942         ENDIF 
     943         WRITE(numout,*) '   fld_fill : fill data structure with information from namelist '//TRIM( cdnam ) 
     944         WRITE(numout,*) '   ~~~~~~~~' 
     945         WRITE(numout,*) '      list of files and frequency (>0: in hours ; <0 in months)' 
    928946         DO jf = 1, SIZE(sdf) 
    929             WRITE(numout,*) '               root filename: '  , TRIM( sdf(jf)%clrootname ),   & 
    930                &                          ' variable name: '  , TRIM( sdf(jf)%clvar      ) 
    931             WRITE(numout,*) '               frequency: '      ,       sdf(jf)%nfreqh      ,   & 
    932                &                          ' time interp: '    ,       sdf(jf)%ln_tint     ,   & 
    933                &                          ' climatology: '    ,       sdf(jf)%ln_clim     ,   & 
    934                &                          ' weights    : '    , TRIM( sdf(jf)%wgtname    ),   & 
    935                &                          ' pairing    : '    , TRIM( sdf(jf)%vcomp      ),   & 
    936                &                          ' data type: '      ,       sdf(jf)%cltype      ,   & 
    937                &                          ' land/sea mask:'   , TRIM( sdf(jf)%lsmname    ) 
     947            WRITE(numout,*) '      root filename: '  , TRIM( sdf(jf)%clrootname ), '   variable name: ', TRIM( sdf(jf)%clvar ) 
     948            WRITE(numout,*) '         frequency: '      ,       sdf(jf)%nfreqh      ,   & 
     949               &                  '   time interp: '    ,       sdf(jf)%ln_tint     ,   & 
     950               &                  '   climatology: '    ,       sdf(jf)%ln_clim 
     951            WRITE(numout,*) '         weights: '        , TRIM( sdf(jf)%wgtname    ),   & 
     952               &                  '   pairing: '        , TRIM( sdf(jf)%vcomp      ),   & 
     953               &                  '   data type: '      ,       sdf(jf)%cltype      ,   & 
     954               &                  '   land/sea mask:'   , TRIM( sdf(jf)%lsmname    ) 
    938955            call flush(numout) 
    939956         END DO 
     
    947964      !!                    ***  ROUTINE wgt_list  *** 
    948965      !! 
    949       !! ** Purpose :   search array of WGTs and find a weights file 
    950       !!                entry, or return a new one adding it to the end 
    951       !!                if it is a new entry, the weights data is read in and 
    952       !!                restructured (fld_weight) 
     966      !! ** Purpose :   search array of WGTs and find a weights file entry, 
     967      !!                or return a new one adding it to the end if new entry. 
     968      !!                the weights data is read in and restructured (fld_weight) 
    953969      !!---------------------------------------------------------------------- 
    954970      TYPE( FLD ), INTENT(in   ) ::   sd        ! field with name of weights file 
     
    10191035      !!                    ***  ROUTINE fld_weight  *** 
    10201036      !! 
    1021       !! ** Purpose :   create a new WGT structure and fill in data from   
    1022       !!                file, restructuring as required 
     1037      !! ** Purpose :   create a new WGT structure and fill in data from file, 
     1038      !!              restructuring as required 
    10231039      !!---------------------------------------------------------------------- 
    10241040      TYPE( FLD ), INTENT(in) ::   sd   ! field with name of weights file 
     
    11631179 
    11641180   SUBROUTINE apply_seaoverland( clmaskfile, zfieldo, jpi1_lsm, jpi2_lsm, jpj1_lsm,   & 
    1165                           &      jpj2_lsm, itmpi, itmpj, itmpz, rec1_lsm, recn_lsm ) 
     1181      &                          jpj2_lsm, itmpi, itmpj, itmpz, rec1_lsm, recn_lsm ) 
    11661182      !!--------------------------------------------------------------------- 
    11671183      !!                    ***  ROUTINE apply_seaoverland  *** 
     
    14921508      !!                    ***  FUNCTION kshift_week ***  
    14931509      !! 
    1494       !! ** Purpose :   
    1495       !!--------------------------------------------------------------------- 
    1496       CHARACTER(len=*), INTENT(in)   ::   cdday   !3 first letters of the first day of the weekly file 
    1497       !! 
    1498       INTEGER                        ::   ksec_week  ! output variable 
    1499       INTEGER                        ::   ijul       !temp variable 
    1500       INTEGER                        ::   ishift     !temp variable 
     1510      !! ** Purpose :   return the first 3 letters of the first day of the weekly file 
     1511      !!--------------------------------------------------------------------- 
     1512      CHARACTER(len=*), INTENT(in)   ::   cdday   ! first 3 letters of the first day of the weekly file 
     1513      !! 
     1514      INTEGER                        ::   ksec_week      ! output variable 
     1515      INTEGER                        ::   ijul, ishift   ! local integer 
    15011516      CHARACTER(len=3),DIMENSION(7)  ::   cl_week  
    15021517      !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.