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 6404 for branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/SAS_SRC – NEMO

Ignore:
Timestamp:
2016-03-29T11:24:48+02:00 (8 years ago)
Author:
timgraham
Message:

First attempt at upgrading branch to the head of the trunk. This should include all of the simplification branch from the merge in Dec 2015.

Location:
branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/SAS_SRC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/SAS_SRC/daymod.F90

    r6401 r6404  
    2020   !! 
    2121   !!   we suppose that the time step is deviding the number of second of in a day 
    22    !!             ---> MOD( rday, rdttra(1) ) == 0 
     22   !!             ---> MOD( rday, rdt ) == 0 
    2323   !! 
    2424   !!           ----------- WARNING ----------- 
     
    7676            &           'You must do a restart at higher frequency (or remove this stop and recompile the code in I8)' ) 
    7777      ENDIF 
    78       ! all calendar staff is based on the fact that MOD( rday, rdttra(1) ) == 0 
    79       IF( MOD( rday     , rdttra(1) ) /= 0. )   CALL ctl_stop( 'the time step must devide the number of second of in a day' ) 
    80       IF( MOD( rday     , 2.        ) /= 0. )   CALL ctl_stop( 'the number of second of in a day must be an even number'    ) 
    81       IF( MOD( rdttra(1), 2.        ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           ) 
    82       nsecd   = NINT(rday           ) 
    83       nsecd05 = NINT(0.5 * rday     ) 
    84       ndt     = NINT(      rdttra(1)) 
    85       ndt05   = NINT(0.5 * rdttra(1)) 
     78      ! all calendar staff is based on the fact that MOD( rday, rdt ) == 0 
     79      IF( MOD( rday , rdt ) /= 0. )   CALL ctl_stop( 'the time step must devide the number of second of in a day' ) 
     80      IF( MOD( rday , 2.  ) /= 0. )   CALL ctl_stop( 'the number of second of in a day must be an even number'    ) 
     81      IF( MOD( rdt  , 2.  ) /= 0. )   CALL ctl_stop( 'the time step (in second) must be an even number'           ) 
     82      nsecd   = NINT(rday         ) 
     83      nsecd05 = NINT(0.5 * rday   ) 
     84      ndt     = NINT(      rdt    ) 
     85      ndt05   = NINT(0.5 * rdt    ) 
    8686 
    8787      ! ==> clem: here we read the ocean restart for the date (only if it exists) 
     
    224224      nsec_week  = nsec_week  + ndt 
    225225      nsec_day   = nsec_day   + ndt                 
    226       adatrj  = adatrj  + rdttra(1) / rday 
    227       fjulday = fjulday + rdttra(1) / rday 
     226      adatrj  = adatrj  + rdt / rday 
     227      fjulday = fjulday + rdt / rday 
    228228      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    229229      IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error 
     
    340340               ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    341341               ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
    342                adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
     342               adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday 
    343343               ! note this is wrong if time step has changed during run 
    344344            ENDIF 
     
    346346            ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    347347            ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
    348             adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
     348            adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday 
    349349         ENDIF 
    350350         IF( ABS(adatrj  - REAL(NINT(adatrj),wp)) < 0.1 / rday )   adatrj = REAL(NINT(adatrj),wp)   ! avoid truncation error 
  • branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/SAS_SRC/diawri.F90

    r6401 r6404  
    2626   USE dom_oce         ! ocean space and time domain 
    2727   USE zdf_oce         ! ocean vertical physics 
    28    USE ldftra_oce      ! ocean active tracers: lateral physics 
    29    USE ldfdyn_oce      ! ocean dynamics: lateral physics 
    30    USE traldf_iso_grif, ONLY : psix_eiv, psiy_eiv 
    31    USE sol_oce         ! solver variables 
    3228   USE sbc_oce         ! Surface boundary condition: ocean fields 
    3329   USE sbc_ice         ! Surface boundary condition: ice fields 
     
    4036   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    4137   USE in_out_manager  ! I/O manager 
    42    USE diadimg         ! dimg direct access file format output 
    4338   USE diaar5, ONLY :   lk_diaar5 
    4439   USE iom 
     
    6560 
    6661   !! * Substitutions 
    67 #  include "zdfddm_substitute.h90" 
    68 #  include "domzgr_substitute.h90" 
    6962#  include "vectopt_loop_substitute.h90" 
    7063   !!---------------------------------------------------------------------- 
     
    8578  END FUNCTION dia_wri_alloc 
    8679 
    87 #if defined key_dimgout 
    88    !!---------------------------------------------------------------------- 
    89    !!   'key_dimgout'                                      DIMG output file 
    90    !!---------------------------------------------------------------------- 
    91 #   include "diawri_dimg.h90" 
    92  
    93 #else 
    9480   !!---------------------------------------------------------------------- 
    9581   !!   Default option                                   NetCDF output file 
    9682   !!---------------------------------------------------------------------- 
    97 # if defined key_iomput 
     83#if defined key_iomput 
    9884   !!---------------------------------------------------------------------- 
    9985   !!   'key_iomput'                                        use IOM library 
     
    11096      !! ** Method  :  use iom_put 
    11197      !!---------------------------------------------------------------------- 
    112       !! 
    113       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     98      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    11499      !!---------------------------------------------------------------------- 
    115100      !  
     
    144129      INTEGER  ::   ierr                                     ! error code return from allocation 
    145130      INTEGER  ::   iimi, iima, ipk, it, itmod, ijmi, ijma   ! local integers 
    146       REAL(wp) ::   zsto, zout, zmax, zjulian, zdt           ! local scalars 
     131      REAL(wp) ::   zsto, zout, zmax, zjulian                ! local scalars 
    147132      !!---------------------------------------------------------------------- 
    148133      !  
     
    163148 
    164149      ! Define frequency of output and means 
    165       zdt = rdt 
    166       IF( nacc == 1 ) zdt = rdtmin 
    167150      IF( ln_mskland )   THEN   ;   clop = "only(x)"   ! put 1.e+20 on land (very expensive!!) 
    168151      ELSE                      ;   clop = "x"         ! no use of the mask value (require less cpu time) 
    169152      ENDIF 
    170153#if defined key_diainstant 
    171       zsto = nwrite * zdt 
     154      zsto = nwrite * rdt 
    172155      clop = "inst("//TRIM(clop)//")" 
    173156#else 
    174       zsto=zdt 
     157      zsto=rdt 
    175158      clop = "ave("//TRIM(clop)//")" 
    176159#endif 
    177       zout = nwrite * zdt 
    178       zmax = ( nitend - nit000 + 1 ) * zdt 
     160      zout = nwrite * rdt 
     161      zmax = ( nitend - nit000 + 1 ) * rdt 
    179162 
    180163      ! Define indices of the horizontal output zoom and vertical limit storage 
     
    218201         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit 
    219202            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    220             &          nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 
     203            &          nit000-1, zjulian, rdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 
    221204         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept 
    222205            &           "m", ipk, gdept_1d, nz_T, "down" ) 
     
    230213         CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu 
    231214            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    232             &          nit000-1, zjulian, zdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 
     215            &          nit000-1, zjulian, rdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 
    233216         CALL histvert( nid_U, "depthu", "Vertical U levels",      &  ! Vertical grid: gdept 
    234217            &           "m", ipk, gdept_1d, nz_U, "down" ) 
     
    242225         CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv 
    243226            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       & 
    244             &          nit000-1, zjulian, zdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 
     227            &          nit000-1, zjulian, rdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 
    245228         CALL histvert( nid_V, "depthv", "Vertical V levels",      &  ! Vertical grid : gdept 
    246229            &          "m", ipk, gdept_1d, nz_V, "down" ) 
     
    338321      ! 
    339322   END SUBROUTINE dia_wri 
    340 # endif 
    341  
    342323#endif 
    343324 
     
    362343      INTEGER  ::   id_i , nz_i, nh_i        
    363344      INTEGER, DIMENSION(1) ::   idex             ! local workspace 
    364       REAL(wp) ::   zsto, zout, zmax, zjulian, zdt 
     345      REAL(wp) ::   zsto, zout, zmax, zjulian 
    365346      !!---------------------------------------------------------------------- 
    366347      !  
     
    373354      clname = cdfile_name 
    374355      IF( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
    375       zdt  = rdt 
    376356      zsto = rdt 
    377357      clop = "inst(x)"           ! no use of the mask value (require less cpu time) 
    378358      zout = rdt 
    379       zmax = ( nitend - nit000 + 1 ) * zdt 
     359      zmax = ( nitend - nit000 + 1 ) * rdt 
    380360 
    381361      IF(lwp) WRITE(numout,*) 
     
    392372      zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    393373      CALL histbeg( clname, jpi, glamt, jpj, gphit,   & 
    394           1, jpi, 1, jpj, nit000-1, zjulian, zdt, nh_i, id_i, domain_id=nidom, snc4chunks=snc4set ) ! Horizontal grid : glamt and gphit 
     374          1, jpi, 1, jpj, nit000-1, zjulian, rdt, nh_i, id_i, domain_id=nidom, snc4chunks=snc4set ) ! Horizontal grid : glamt and gphit 
    395375      CALL histvert( id_i, "deptht", "Vertical T levels",   &    ! Vertical grid : gdept 
    396376          "m", jpk, gdept_1d, nz_i, "down") 
     
    435415      ! ----------------- 
    436416      CALL histclo( id_i ) 
    437 #if ! defined key_iomput && ! defined key_dimgout 
     417#if ! defined key_iomput 
    438418      IF( ninist /= 1  ) THEN 
    439419         CALL histclo( nid_T ) 
  • branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r6401 r6404  
    184184      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    185185         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    186          &             nn_bench, nn_timing 
     186         &             nn_bench, nn_timing, nn_diacfl 
    187187      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    188188         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
     
    521521#endif 
    522522      ! 
    523       INTEGER :: ierr,ierr1,ierr2,ierr3,ierr4,ierr5,ierr6 
     523      INTEGER :: ierr,ierr1,ierr2,ierr3,ierr4,ierr5,ierr6,ierr7,ierr8 
    524524      INTEGER :: jpm 
    525525      !!---------------------------------------------------------------------- 
     
    545545      ALLOCATE( tsb(jpi,jpj,1,jpm)  , STAT=ierr5 ) 
    546546      ALLOCATE( sshn(jpi,jpj)       , STAT=ierr6 ) 
    547       ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6  
     547      ALLOCATE( un(jpi,jpj,1)       , STAT=ierr7 ) 
     548      ALLOCATE( vn(jpi,jpj,1)       , STAT=ierr8 ) 
     549      ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6 + ierr7 + ierr8 
    548550#endif 
    549551      ! 
  • branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90

    r6401 r6404  
    8888         ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
    8989         ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
    90          IF( lk_vvl )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
     90         IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
    9191      ELSE 
    9292         ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
    9393         ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
    94          IF( lk_vvl )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
     94         IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
    9595      ENDIF 
    9696      ! 
     
    115115         CALL prt_ctl(tab2d_1=ssv_m, clinfo1=' ssv_m   - : ', mask1=vmask, ovlap=1   ) 
    116116         CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' ssh_m   - : ', mask1=tmask, ovlap=1   ) 
    117          IF( lk_vvl      )   CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m   - : ', mask1=tmask, ovlap=1   ) 
    118          IF( ln_read_frq )   CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m   - : ', mask1=tmask, ovlap=1   ) 
     117         IF( .NOT.ln_linssh )   CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m   - : ', mask1=tmask, ovlap=1   ) 
     118         IF( ln_read_frq    )   CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m   - : ', mask1=tmask, ovlap=1   ) 
    119119      ENDIF 
    120120      ! 
     
    125125         CALL iom_put( 'sss_m', sss_m ) 
    126126         CALL iom_put( 'ssh_m', ssh_m ) 
    127          IF( lk_vvl      )   CALL iom_put( 'e3t_m', e3t_m ) 
    128          IF( ln_read_frq )   CALL iom_put( 'frq_m', frq_m ) 
     127         IF( .NOT.ln_linssh )   CALL iom_put( 'e3t_m', e3t_m ) 
     128         IF( ln_read_frq    )   CALL iom_put( 'frq_m', frq_m ) 
    129129      ENDIF 
    130130      ! 
     
    216216      IF( ln_3d_uve ) THEN 
    217217         jf_usp = 1 ; jf_vsp = 2 ; jf_e3t = 3      ! define 3D fields index 
    218          nfld_3d  = 2 + COUNT( (/lk_vvl/) )        ! number of 3D fields to read 
     218         nfld_3d  = 2 + COUNT( (/.NOT.ln_linssh/) )        ! number of 3D fields to read 
    219219         nfld_2d  = 3 + COUNT( (/ln_read_frq/) )   ! number of 2D fields to read 
    220220      ELSE 
    221          jf_usp = 4 ; jf_vsp = 5 ; jf_e3t = 6 ; jf_frq = 6 + COUNT( (/lk_vvl/) )   ! update 2D fields index 
     221         jf_usp = 4 ; jf_vsp = 5 ; jf_e3t = 6 ; jf_frq = 6 + COUNT( (/.NOT.ln_linssh/) )   ! update 2D fields index 
    222222         nfld_3d  = 0                                                              ! no 3D fields to read 
    223          nfld_2d  = 5 + COUNT( (/lk_vvl/) ) + COUNT( (/ln_read_frq/) )             ! number of 2D fields to read 
     223         nfld_2d  = 5 + COUNT( (/.NOT.ln_linssh/) ) + COUNT( (/ln_read_frq/) )             ! number of 2D fields to read 
    224224      ENDIF 
    225225 
     
    231231         slf_3d(jf_usp) = sn_usp 
    232232         slf_3d(jf_vsp) = sn_vsp 
    233          IF( lk_vvl )   slf_3d(jf_e3t) = sn_e3t 
     233         IF( .NOT.ln_linssh )   slf_3d(jf_e3t) = sn_e3t 
    234234      ENDIF 
    235235 
     
    243243         IF( .NOT. ln_3d_uve ) THEN 
    244244            slf_2d(jf_usp) = sn_usp ; slf_2d(jf_vsp) = sn_vsp 
    245             IF( lk_vvl )   slf_2d(jf_e3t) = sn_e3t 
     245            IF( .NOT.ln_linssh )   slf_2d(jf_e3t) = sn_e3t 
    246246         ENDIF 
    247247      ENDIF 
  • branches/2015/dev_r5803_UKMO_AGRIF_Vert_interp/NEMOGCM/NEMO/SAS_SRC/step.F90

    r6401 r6404  
    1616   USE oce              ! ocean dynamics and tracers variables 
    1717   USE dom_oce          ! ocean space and time domain variables  
    18    USE in_out_manager   ! I/O manager 
    19    USE sbc_oce 
    20    USE sbccpl 
    21    USE iom              ! 
    22    USE lbclnk 
    23 #if defined key_iomput 
    24    USE xios 
    25 #endif 
    26  
    2718   USE daymod           ! calendar                         (day     routine) 
    28  
     19   USE sbc_oce          ! surface boundary condition: fields 
    2920   USE sbcmod           ! surface boundary condition       (sbc     routine) 
    3021   USE sbcrnf           ! surface boundary condition: runoff variables 
    31  
     22   USE sbccpl           ! surface boundary condition: coupled interface 
    3223   USE eosbn2           ! equation of state                (eos_bn2 routine) 
    33  
    3424   USE diawri           ! Standard run outputs             (dia_wri routine) 
    35    USE stpctl           ! time stepping control            (stp_ctl routine) 
    36    USE prtctl           ! Print control                    (prt_ctl routine) 
    37  
    38    USE timing           ! Timing             
    39  
    4025   USE bdy_par          ! clem: mandatory for LIM3 
    4126#if defined key_bdy 
    4227   USE bdydta           ! clem: mandatory for LIM3 
     28#endif 
     29   USE stpctl           ! time stepping control            (stp_ctl routine) 
     30   ! 
     31   USE in_out_manager   ! I/O manager 
     32   USE prtctl           ! Print control                    (prt_ctl routine) 
     33   USE iom              ! 
     34   USE lbclnk           ! 
     35   USE timing           ! Timing             
     36#if defined key_iomput 
     37   USE xios 
    4338#endif 
    4439 
     
    4641   PRIVATE 
    4742 
    48    PUBLIC   stp   ! called by opa.F90 
     43   PUBLIC   stp   ! called by nemogcm.F90 
    4944 
    50    !! * Substitutions 
    51 #  include "domzgr_substitute.h90" 
    52 #  include "zdfddm_substitute.h90" 
    5345   !!---------------------------------------------------------------------- 
    5446   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
Note: See TracChangeset for help on using the changeset viewer.