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 3865 for branches/2013/dev_r3858_NOC_ZTC/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2013-04-09T18:34:38+02:00 (11 years ago)
Author:
acc
Message:

Branch 2013/dev_r3858_NOC_ZTC, #863. Nearly complete port of 2011/dev_r2739_LOCEAN8_ZTC development branch into v3.5aplha base. Compiles and runs but currently unstable after 8 timesteps with ORCA2_LIM reference configuration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r3858_NOC_ZTC/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r3862 r3865  
    142142      ENDIF 
    143143 
    144       CALL iom_put( "toce"   , tsn(:,:,:,jp_tem)                     )    ! temperature 
    145       CALL iom_put( "soce"   , tsn(:,:,:,jp_sal)                     )    ! salinity 
    146       CALL iom_put( "sst"    , tsn(:,:,1,jp_tem)                     )    ! sea surface temperature 
    147       CALL iom_put( "sst2"   , tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) )    ! square of sea surface temperature 
    148       CALL iom_put( "sss"    , tsn(:,:,1,jp_sal)                     )    ! sea surface salinity 
    149       CALL iom_put( "sss2"   , tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) )    ! square of sea surface salinity 
    150       CALL iom_put( "uoce"   , un                                    )    ! i-current       
    151       CALL iom_put( "suoce"  , un(:,:,1)                             )    ! surface i-current       
    152       CALL iom_put( "voce"   , vn                                    )    ! j-current 
    153       CALL iom_put( "svoce"  , vn(:,:,1)                             )    ! surface j-current 
    154   
    155       CALL iom_put( "avt"    , avt                                   )    ! T vert. eddy diff. coef. 
    156       CALL iom_put( "avm"    , avmu                                  )    ! T vert. eddy visc. coef. 
     144      IF( lk_vvl ) THEN 
     145         z3d(:,:,:) = tsn(:,:,:,jp_tem) * fse3t_n(:,:,:) 
     146         CALL iom_put( "toce" , z3d                        )   ! heat content 
     147         CALL iom_put( "sst"  , z3d(:,:,1)                 )   ! sea surface heat content 
     148         CALL iom_put( "sst2" , z3d(:,:,1) * z3d(:,:,1)    )   ! sea surface content of squared temperature 
     149         z3d(:,:,:) = tsn(:,:,:,jp_sal) * fse3t_n(:,:,:)             
     150         CALL iom_put( "soce" , z3d                        )   ! salinity content 
     151         CALL iom_put( "sss"  , z3d(:,:,1)                 )   ! sea surface salinity content 
     152         CALL iom_put( "sss2" , z3d(:,:,1) * z3d(:,:,1)    )   ! sea surface content of squared salinity 
     153      ELSE 
     154         CALL iom_put( "toce" , tsn(:,:,:,jp_tem)          )   ! temperature 
     155         CALL iom_put( "sst"  , tsn(:,:,1,jp_tem)          )   ! sea surface temperature 
     156         CALL iom_put( "sst2" , tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) ) ! square of sea surface temperature 
     157         CALL iom_put( "soce" , tsn(:,:,:,jp_sal)          )   ! salinity 
     158         CALL iom_put( "sss"  , tsn(:,:,1,jp_sal)          )   ! sea surface salinity 
     159         CALL iom_put( "sss2" , tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) ) ! square of sea surface salinity 
     160      END IF 
     161      IF( lk_vvl .AND. (.NOT. ln_dynadv_vec) ) THEN 
     162         CALL iom_put( "uoce" , un(:,:,:) * fse3u_n(:,:,:) )    ! i-transport 
     163         CALL iom_put( "voce" , vn(:,:,:) * fse3v_n(:,:,:) )    ! j-transport 
     164      ELSE 
     165         CALL iom_put( "uoce" , un                         )    ! i-current 
     166         CALL iom_put( "voce" , vn                         )    ! j-current 
     167      END IF 
     168      CALL iom_put(    "avt"  , avt                        )    ! T vert. eddy diff. coef. 
     169      CALL iom_put(    "avm"  , avmu                       )    ! T vert. eddy visc. coef. 
    157170      IF( lk_zdfddm ) THEN 
    158171         CALL iom_put( "avs" , fsavs(:,:,:)                          )    ! S vert. eddy diff. coef. 
     
    250263      ! 
    251264      CALL wrk_alloc( jpi , jpj      , zw2d ) 
    252       IF ( ln_traldf_gdia )  call wrk_alloc( jpi , jpj , jpk  , zw3d ) 
     265      IF ( ln_traldf_gdia .OR. lk_vvl )  call wrk_alloc( jpi , jpj , jpk  , zw3d ) 
    253266      ! 
    254267      ! Output the initial state and forcings 
     
    395408         CALL histdef( nid_T, "vosaline", "Salinity"                           , "PSU"    ,   &  ! sn 
    396409            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     410         IF(  lk_vvl  ) THEN 
     411            CALL histdef( nid_T, "vovvle3t", "Level thickness"                    , "m"      ,&  ! e3t_n 
     412            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     413            CALL histdef( nid_T, "vovvldep", "T point depth"                      , "m"      ,&  ! e3t_n 
     414            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     415            CALL histdef( nid_T, "vovvldef", "Squared level deformation"          , "%^2"    ,&  ! e3t_n 
     416            &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     417         ENDIF 
    397418         !                                                                                      !!! nid_T : 2D 
    398419         CALL histdef( nid_T, "sosstsst", "Sea Surface temperature"            , "C"      ,   &  ! sst 
     
    406427         CALL histdef( nid_T, "sosfldow", "downward salt flux"                 , "PSU/m2/s",  &  ! sfx 
    407428            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    408 #if ! defined key_vvl 
    409          CALL histdef( nid_T, "sosst_cd", "Concentration/Dilution term on temperature"        &  ! emp * tsn(:,:,1,jp_tem) 
     429         IF(  .NOT. lk_vvl  ) THEN 
     430            CALL histdef( nid_T, "sosst_cd", "Concentration/Dilution term on temperature"     &  ! emp * tsn(:,:,1,jp_tem) 
    410431            &                                                                  , "KgC/m2/s",  &  ! sosst_cd 
    411             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    412          CALL histdef( nid_T, "sosss_cd", "Concentration/Dilution term on salinity"           &  ! emp * tsn(:,:,1,jp_sal) 
     432            &             jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     433            CALL histdef( nid_T, "sosss_cd", "Concentration/Dilution term on salinity"        &  ! emp * tsn(:,:,1,jp_sal) 
    413434            &                                                                  , "KgPSU/m2/s",&  ! sosss_cd 
    414             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    415 #endif 
     435            &             jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     436         ENDIF 
    416437         CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux"             , "W/m2"   ,   &  ! qns + qsr 
    417438            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     
    585606      ! --------------------- 
    586607 
    587       ! ndex(1) est utilise ssi l'avant dernier argument est diffferent de  
     608      ! ndex(1) est utilise ssi l'avant dernier argument est different de  
    588609      ! la taille du tableau en sortie. Dans ce cas , l'avant dernier argument 
    589610      ! donne le nombre d'elements, et ndex la liste des indices a sortir 
     
    595616 
    596617      ! Write fields on T grid 
    597       CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem), ndim_T , ndex_T  )   ! temperature 
    598       CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal), ndim_T , ndex_T  )   ! salinity 
    599       CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem), ndim_hT, ndex_hT )   ! sea surface temperature 
    600       CALL histwrite( nid_T, "sosaline", it, tsn(:,:,1,jp_sal), ndim_hT, ndex_hT )   ! sea surface salinity 
     618      IF( lk_vvl ) THEN 
     619         CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem) * fse3t_n(:,:,:) , ndim_T , ndex_T  )   ! heat content 
     620         CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal) * fse3t_n(:,:,:) , ndim_T , ndex_T  )   ! salt content 
     621         CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem) * fse3t_n(:,:,1) , ndim_hT, ndex_hT )   ! sea surface heat content 
     622         CALL histwrite( nid_T, "sosaline", it, tsn(:,:,1,jp_sal) * fse3t_n(:,:,1) , ndim_hT, ndex_hT )   ! sea surface salinity content 
     623      ELSE 
     624         CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem) , ndim_T , ndex_T  )   ! temperature 
     625         CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal) , ndim_T , ndex_T  )   ! salinity 
     626         CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem) , ndim_hT, ndex_hT )   ! sea surface temperature 
     627         CALL histwrite( nid_T, "sosaline", it, tsn(:,:,1,jp_sal) , ndim_hT, ndex_hT )   ! sea surface salinity 
     628 
     629      ENDIF 
     630      IF( lk_vvl ) THEN 
     631         z3d(:,:,:) = ( ( fse3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 
     632         CALL histwrite( nid_T, "vovvle3t", it, fse3t_n (:,:,:) , ndim_T , ndex_T  )   ! level thickness 
     633         CALL histwrite( nid_T, "vovvldep", it, fsdept_n(:,:,:) , ndim_T , ndex_T  )   ! t-point depth 
     634         CALL histwrite( nid_T, "vovvldef", it, z3d             , ndim_T , ndex_T  )   ! level thickness deformation 
     635      ENDIF 
    601636      CALL histwrite( nid_T, "sossheig", it, sshn          , ndim_hT, ndex_hT )   ! sea surface height 
    602637      CALL histwrite( nid_T, "sowaflup", it, ( emp-rnf )   , ndim_hT, ndex_hT )   ! upward water flux 
     
    604639                                                                                  ! (includes virtual salt flux beneath ice  
    605640                                                                                  ! in linear free surface case) 
    606 #if ! defined key_vvl 
    607       zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_tem) 
    608       CALL histwrite( nid_T, "sosst_cd", it, zw2d, ndim_hT, ndex_hT )             ! c/d term on sst 
    609       zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_sal) 
    610       CALL histwrite( nid_T, "sosss_cd", it, zw2d, ndim_hT, ndex_hT )             ! c/d term on sss 
    611 #endif 
     641      IF( .NOT. lk_vvl ) THEN 
     642         zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_tem) 
     643         CALL histwrite( nid_T, "sosst_cd", it, zw2d, ndim_hT, ndex_hT )          ! c/d term on sst 
     644         zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_sal) 
     645         CALL histwrite( nid_T, "sosss_cd", it, zw2d, ndim_hT, ndex_hT )          ! c/d term on sss 
     646      ENDIF 
    612647      CALL histwrite( nid_T, "sohefldo", it, qns + qsr     , ndim_hT, ndex_hT )   ! total heat flux 
    613648      CALL histwrite( nid_T, "soshfldo", it, qsr           , ndim_hT, ndex_hT )   ! solar heat flux 
     
    750785      ! 
    751786      CALL wrk_dealloc( jpi , jpj      , zw2d ) 
    752       IF ( ln_traldf_gdia )  call wrk_dealloc( jpi , jpj , jpk  , zw3d ) 
     787      IF ( ln_traldf_gdia .OR. lk_vvl )  call wrk_dealloc( jpi , jpj , jpk  , zw3d ) 
    753788      ! 
    754789      IF( nn_timing == 1 )   CALL timing_stop('dia_wri') 
     
    839874      CALL histdef( id_i, "sometauy", "Meridional Wind Stress", "N/m2"   ,   &   ! j-wind stress 
    840875         &          jpi, jpj, nh_i, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     876      IF( lk_vvl ) THEN 
     877         CALL histdef( id_i, "vovvldep", "T point depth"         , "m"      ,   &   ! t-point depth 
     878            &          jpi, jpj, nh_i, jpk, 1, jpk, nz_i, 32, clop, zsto, zout ) 
     879      END IF 
    841880 
    842881#if defined key_lim2 
Note: See TracChangeset for help on using the changeset viewer.