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 2970 for branches/2011/dev_r2739_LOCEAN8_ZTC/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2011-10-20T18:21:47+02:00 (13 years ago)
Author:
mlelod
Message:

thickness weighted outputs and additional outputs, see ticket/863?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_r2739_LOCEAN8_ZTC/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r2715 r2970  
    3333   USE sbcssr          ! restoring term toward SST/SSS climatology 
    3434   USE phycst          ! physical constants 
     35   USE dynadv          ! dynamics: vector invariant versus flux form 
    3536   USE zdfmxl          ! mixed layer 
    3637   USE dianam          ! build name of file (routine) 
     
    126127      !!---------------------------------------------------------------------- 
    127128      !  
    128       IF( wrk_in_use(2, 1))THEN 
     129      IF( wrk_in_use(2, 1) )THEN 
    129130         CALL ctl_stop('dia_wri: ERROR - requested 2D workspace unavailable.') 
    130131         RETURN 
     
    137138      ENDIF 
    138139 
    139       CALL iom_put( "toce"   , tn                    )    ! temperature 
    140       CALL iom_put( "soce"   , sn                    )    ! salinity 
    141       CALL iom_put( "sst"    , tn(:,:,1)             )    ! sea surface temperature 
    142       CALL iom_put( "sst2"   , tn(:,:,1) * tn(:,:,1) )    ! square of sea surface temperature 
    143       CALL iom_put( "sss"    , sn(:,:,1)             )    ! sea surface salinity 
    144       CALL iom_put( "sss2"   , sn(:,:,1) * sn(:,:,1) )    ! square of sea surface salinity 
    145       CALL iom_put( "uoce"   , un                    )    ! i-current       
    146       CALL iom_put( "voce"   , vn                    )    ! j-current 
    147        
    148       CALL iom_put( "avt"    , avt                   )    ! T vert. eddy diff. coef. 
    149       CALL iom_put( "avm"    , avmu                  )    ! T vert. eddy visc. coef. 
     140      IF( lk_vvl ) THEN 
     141         z3d(:,:,:) = tn(:,:,:) * fse3t_n(:,:,:) 
     142         CALL iom_put( "toce" , z3d                        )   ! heat content 
     143         CALL iom_put( "sst"  , z3d(:,:,1)                 )   ! sea surface heat content 
     144         CALL iom_put( "sst2" , z3d(:,:,1) * tn(:,:,1)     )   ! sea surface content of squared temperature 
     145         z3d(:,:,:) = sn(:,:,:) * fse3t_n(:,:,:)             
     146         CALL iom_put( "soce" , z3d                        )   ! salinity content 
     147         CALL iom_put( "sss"  , z3d(:,:,1)                 )   ! sea surface salinity content 
     148         CALL iom_put( "sss2" , z3d(:,:,1) * sn(:,:,1)     )   ! sea surface content of squared salinity 
     149      ELSE 
     150         CALL iom_put( "toce" , tn                         )   ! temperature 
     151         CALL iom_put( "sst"  , tn(:,:,1)                  )   ! sea surface temperature 
     152         CALL iom_put( "sst2" , tn(:,:,1) * tn(:,:,1)      )   ! square of sea surface temperature 
     153         CALL iom_put( "soce" , sn                         )   ! salinity 
     154         CALL iom_put( "sss"  , sn(:,:,1)                  )   ! sea surface salinity 
     155         CALL iom_put( "sss2" , sn(:,:,1) * sn(:,:,1)      )   ! square of sea surface salinity 
     156      END IF 
     157      IF( lk_vvl .AND. (.NOT. ln_dynadv_vec) ) THEN 
     158         CALL iom_put( "uoce" , un(:,:,:) * fse3u_n(:,:,:) )    ! i-transport 
     159         CALL iom_put( "voce" , vn(:,:,:) * fse3v_n(:,:,:) )    ! j-transport 
     160      ELSE 
     161         CALL iom_put( "uoce" , un                         )    ! i-current 
     162         CALL iom_put( "voce" , vn                         )    ! j-current 
     163      END IF 
     164      CALL iom_put(    "avt"  , avt                        )    ! T vert. eddy diff. coef. 
     165      CALL iom_put(    "avm"  , avmu                       )    ! T vert. eddy visc. coef. 
    150166      IF( lk_zdfddm ) THEN 
    151          CALL iom_put( "avs" , fsavs(:,:,:)          )    ! S vert. eddy diff. coef. 
     167         CALL iom_put( "avs"  , fsavs(:,:,:)               )    ! S vert. eddy diff. coef. 
    152168      ENDIF 
    153169 
     
    170186         z3d(:,:,jpk) = 0.e0 
    171187         DO jk = 1, jpkm1 
    172             z3d(:,:,jk) = rau0 * un(:,:,jk) * e1u(:,:) * fse3u(:,:,jk) 
     188            z3d(:,:,jk) = rau0 * un(:,:,jk) * e1u(:,:) * fse3u_n(:,:,jk) 
    173189         END DO 
    174190         CALL iom_put( "u_masstr", z3d )                  ! mass transport in i-direction 
     
    185201         CALL iom_put( "u_heattr", z2d )                  ! heat transport in i-direction 
    186202         DO jk = 1, jpkm1 
    187             z3d(:,:,jk) = rau0 * vn(:,:,jk) * e2v(:,:) * fse3v(:,:,jk) 
     203            z3d(:,:,jk) = rau0 * vn(:,:,jk) * e2v(:,:) * fse3v_n(:,:,jk) 
    188204         END DO 
    189205         CALL iom_put( "v_masstr", z3d )                  ! mass transport in j-direction 
     
    197213         END DO 
    198214         CALL lbc_lnk( z2d, 'V', -1. ) 
    199          CALL iom_put( "v_heattr", z2d )                  !  heat transport in i-direction 
    200       ENDIF 
    201       ! 
    202       IF( wrk_not_released(2, 1))THEN 
     215         CALL iom_put( "v_heattr", z2d )                  !  heat transport in j-direction 
     216      ENDIF 
     217      ! 
     218      IF( wrk_not_released(2, 1) ) THEN 
    203219         CALL ctl_stop('dia_wri: ERROR - failed to release 2D workspace.') 
    204220         RETURN 
     
    224240      !!      Each nwrite time step, output the instantaneous or mean fields 
    225241      !!---------------------------------------------------------------------- 
     242      USE oce, ONLY :   z3d => ta   ! use ta as 3D workspace 
    226243      USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 
    227244      USE wrk_nemo, ONLY: zw2d => wrk_2d_1 
     
    361378         CALL histdef( nid_T, "vosaline", "Salinity"                           , "PSU"    ,   &  ! sn 
    362379            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     380#if defined key_vvl 
     381         CALL histdef( nid_T, "vovvle3t", "Level thickness"                    , "m"      ,   &  ! e3t_n 
     382            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     383         CALL histdef( nid_T, "vovvldep", "T point depth"                      , "m"      ,   &  ! e3t_n 
     384            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     385         CALL histdef( nid_T, "vovvldef", "Squared level deformation"          , "%^2"    ,   &  ! e3t_n 
     386            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 
     387#endif 
    363388         !                                                                                      !!! nid_T : 2D 
    364389         CALL histdef( nid_T, "sosstsst", "Sea Surface temperature"            , "C"      ,   &  ! sst 
     
    439464            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    440465# endif  
    441 #endif  
     466#endif 
    442467 
    443468         CALL histend( nid_T, snc4chunks=snc4set ) 
     
    516541 
    517542      ! Write fields on T grid 
    518       CALL histwrite( nid_T, "votemper", it, tn            , ndim_T , ndex_T  )   ! temperature 
    519       CALL histwrite( nid_T, "vosaline", it, sn            , ndim_T , ndex_T  )   ! salinity 
    520       CALL histwrite( nid_T, "sosstsst", it, tn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface temperature 
    521       CALL histwrite( nid_T, "sosaline", it, sn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface salinity 
     543      IF( lk_vvl ) THEN 
     544         CALL histwrite( nid_T, "votemper", it, tn(:,:,:) * fse3t_n(:,:,:) , ndim_T , ndex_T  )   ! heat content 
     545         CALL histwrite( nid_T, "vosaline", it, sn(:,:,:) * fse3t_n(:,:,:) , ndim_T , ndex_T  )   ! salt content 
     546         CALL histwrite( nid_T, "sosstsst", it, tn(:,:,1) * fse3t_n(:,:,1) , ndim_hT, ndex_hT )   ! sea surface heat content 
     547         CALL histwrite( nid_T, "sosaline", it, sn(:,:,1) * fse3t_n(:,:,1) , ndim_hT, ndex_hT )   ! sea surface salinity content 
     548      ELSE 
     549         CALL histwrite( nid_T, "votemper", it, tn            , ndim_T , ndex_T  )   ! temperature 
     550         CALL histwrite( nid_T, "vosaline", it, sn            , ndim_T , ndex_T  )   ! salinity 
     551         CALL histwrite( nid_T, "sosstsst", it, tn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface temperature 
     552         CALL histwrite( nid_T, "sosaline", it, sn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface salinity 
     553 
     554      ENDIF 
     555      IF( lk_vvl ) THEN 
     556         z3d(:,:,:) = ( ( fse3t_n(:,:,:) - fse3t_0(:,:,:) ) / fse3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 
     557         CALL histwrite( nid_T, "vovvle3t", it, fse3t_n (:,:,:) , ndim_T , ndex_T  )   ! level thickness 
     558         CALL histwrite( nid_T, "vovvldep", it, fsdept_n(:,:,:) , ndim_T , ndex_T  )   ! t-point depth 
     559         CALL histwrite( nid_T, "vovvldef", it, z3d             , ndim_T , ndex_T  )   ! level thickness deformation 
     560      ENDIF 
    522561      CALL histwrite( nid_T, "sossheig", it, sshn          , ndim_hT, ndex_hT )   ! sea surface height 
    523562!!$#if  defined key_lim3 || defined key_lim2  
     
    569608#endif 
    570609         ! Write fields on U grid 
    571       CALL histwrite( nid_U, "vozocrtx", it, un            , ndim_U , ndex_U )    ! i-current 
     610      IF( lk_vvl .AND. (.NOT. ln_dynadv_vec) ) THEN 
     611         CALL histwrite( nid_U, "vozocrtx", it, un(:,:,:) * fse3u_n(:,:,:), ndim_U , ndex_U )    ! i-transport 
     612      ELSE 
     613         CALL histwrite( nid_U, "vozocrtx", it, un            , ndim_U , ndex_U )    ! i-current 
     614      ENDIF 
    572615#if defined key_diaeiv 
    573616      CALL histwrite( nid_U, "vozoeivu", it, u_eiv         , ndim_U , ndex_U )    ! i-eiv current 
     
    576619 
    577620         ! Write fields on V grid 
    578       CALL histwrite( nid_V, "vomecrty", it, vn            , ndim_V , ndex_V  )   ! j-current 
     621      IF( lk_vvl .AND. (.NOT. ln_dynadv_vec) ) THEN 
     622         CALL histwrite( nid_V, "vomecrty", it, vn(:,:,:) * fse3v_n(:,:,:), ndim_V , ndex_V  )   ! j-transport 
     623      ELSE 
     624         CALL histwrite( nid_V, "vomecrty", it, vn            , ndim_V , ndex_V  )   ! j-current 
     625      END IF 
    579626#if defined key_diaeiv 
    580627      CALL histwrite( nid_V, "vomeeivv", it, v_eiv         , ndim_V , ndex_V  )   ! j-eiv current 
     
    676723      CALL histdef( id_i, "votemper", "Temperature"           , "C"      ,   &   ! temperature 
    677724         &          jpi, jpj, nh_i, jpk, 1, jpk, nz_i, 32, clop, zsto, zout ) 
    678       CALL histdef( id_i, "sossheig", "Sea Surface Height"    , "m"      ,   &  ! ssh 
     725      CALL histdef( id_i, "sossheig", "Sea Surface Height"    , "m"      ,   &   ! ssh 
    679726         &          jpi, jpj, nh_i, 1  , 1, 1  , nz_i, 32, clop, zsto, zout ) 
    680727      CALL histdef( id_i, "vozocrtx", "Zonal Current"         , "m/s"    ,   &   ! zonal current 
     
    696743      CALL histdef( id_i, "sometauy", "Meridional Wind Stress", "N/m2"   ,   &   ! j-wind stress 
    697744         &          jpi, jpj, nh_i, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
     745      IF( lk_vvl ) THEN 
     746         CALL histdef( id_i, "vovvldep", "T point depth"         , "m"      ,   &   ! t-point depth 
     747            &          jpi, jpj, nh_i, jpk, 1, jpk, nz_i, 32, clop, zsto, zout ) 
     748      END IF 
    698749 
    699750#if defined key_lim2 
     
    711762 
    712763      ! Write all fields on T grid 
    713       CALL histwrite( id_i, "votemper", kt, tn      , jpi*jpj*jpk, idex )    ! now temperature 
    714       CALL histwrite( id_i, "vosaline", kt, sn      , jpi*jpj*jpk, idex )    ! now salinity 
     764      CALL histwrite( id_i, "votemper", kt, tn       , jpi*jpj*jpk, idex )    ! now temperature 
     765      CALL histwrite( id_i, "vosaline", kt, sn       , jpi*jpj*jpk, idex )    ! now salinity 
    715766      CALL histwrite( id_i, "sossheig", kt, sshn     , jpi*jpj    , idex )    ! sea surface height 
    716767      CALL histwrite( id_i, "vozocrtx", kt, un       , jpi*jpj*jpk, idex )    ! now i-velocity 
     
    723774      CALL histwrite( id_i, "sozotaux", kt, utau     , jpi*jpj    , idex )    ! i-wind stress 
    724775      CALL histwrite( id_i, "sometauy", kt, vtau     , jpi*jpj    , idex )    ! j-wind stress 
     776      IF( lk_vvl ) THEN 
     777         CALL histwrite( id_i, "vovvldep", kt, fsdept_n(:,:,:), jpi*jpj*jpk, idex )    ! t-point depth 
     778      END IF 
    725779 
    726780      ! 3. Close the file 
Note: See TracChangeset for help on using the changeset viewer.