Changeset 900 for trunk/NEMO/C1D_SRC/diawri_c1d.F90
- Timestamp:
- 2008-04-22T20:13:41+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/C1D_SRC/diawri_c1d.F90
r899 r900 1 MODULE diawri 1d1 MODULE diawri_c1d 2 2 !!====================================================================== 3 !! *** MODULE diawri 1d ***3 !! *** MODULE diawri_c1d *** 4 4 !! Ocean diagnostics : write ocean output files 5 5 !!===================================================================== 6 !! History : 2.0 ! 2004-10 (C. Ethe) 1D Configuration 7 !! 3.0 ! 2008-04 (G. Madec) adaptation to SBC 8 !!---------------------------------------------------------------------- 6 9 #if defined key_c1d 7 10 !!---------------------------------------------------------------------- 8 !! 'key_c1d' 1D Configuration11 !! 'key_c1d' 1D Configuration 9 12 !!---------------------------------------------------------------------- 10 !! ----------------------------------------------------------------------11 !! * Modules used13 !! dia_wri_c1d : create the standart NetCDF output files 14 !!---------------------------------------------------------------------- 12 15 USE oce ! ocean dynamics and tracers 13 16 USE dom_oce ! ocean space and time domain … … 15 18 USE sbc_oce ! surface boundary condition: ocean 16 19 USE sbc_ice ! surface boundary condition: ice 20 USE sbcmod ! surface Boundary Codition 21 USE sbcssr ! surface boundary condition: restauring to SSS and or SST 17 22 USE zdftke ! TKE vertical mixing 18 23 USE zdfkpp ! KPP vertical mixing … … 26 31 USE diawri 27 32 USE zdfddm ! vertical physics: double diffusion 28 USE diahth ! thermocline diagnostics29 33 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 30 34 USE in_out_manager ! I/O manager 35 USE ioipsl 31 36 32 37 IMPLICIT NONE 33 38 PRIVATE 34 39 35 !! * Accessibility 36 PUBLIC dia_wri_1d ! routines called by step.F90 37 !! * Module variables 38 INTEGER :: & 39 nid_T, nz_T, nh_T, ndim_T, ndim_hT, & ! grid_T file 40 ndex(1) ! ??? 41 INTEGER, DIMENSION(jpi*jpj) :: & 42 ndex_hT 43 INTEGER, DIMENSION(jpi*jpj*jpk) :: & 44 ndex_T 40 PUBLIC dia_wri_c1d ! routines called by step.F90 41 42 INTEGER :: nid_T, nz_T, nh_T, ndim_T, ndim_hT, ndex(1) ! grid_T file 43 INTEGER, DIMENSION(jpi*jpj) :: ndex_hT 44 INTEGER, DIMENSION(jpi*jpj*jpk) :: ndex_T 45 45 46 46 !! * Substitutions 47 47 # include "zdfddm_substitute.h90" 48 48 !!---------------------------------------------------------------------- 49 !! OPA 9.0 , LOCEAN-IPSL (2005)49 !! NEMO/C1D 3.0 , LOCEAN-IPSL (2008) 50 50 !! $Id$ 51 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt51 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 52 52 !!---------------------------------------------------------------------- 53 53 54 54 CONTAINS 55 !!---------------------------------------------------------------------- 56 !! Default option NetCDF output file 57 !!---------------------------------------------------------------------- 58 !! dia_wri_1d : create the standart NetCDF output files 59 !! dia_wri_state_1d : create an output NetCDF file for a single 60 !! instantaeous ocean state and forcing fields 61 !!---------------------------------------------------------------------- 62 63 SUBROUTINE dia_wri_1d( kt, kindic ) 55 56 SUBROUTINE dia_wri_c1d( kt, kindic ) 64 57 !!--------------------------------------------------------------------- 65 !! *** ROUTINE dia_wri_ 1d ***58 !! *** ROUTINE dia_wri_c1d *** 66 59 !! 67 60 !! ** Purpose : Standard output of opa: dynamics and tracer fields … … 75 68 !! IF kindic =0, time step loop 76 69 !! IF kindic >0, output of fields before the time step loop 77 !!78 !! History :79 !! ! 91-03 (M.-A. Foujols) Original code80 !! ! 91-11 (G. Madec)81 !! ! 92-06 (M. Imbard) correction restart file82 !! ! 92-07 (M. Imbard) split into diawri and rstwri83 !! ! 93-03 (M. Imbard) suppress writibm84 !! ! 98-01 (C. Levy) NETCDF format using ioipsl INTERFACE85 !! ! 99-02 (E. Guilyardi) name of netCDF files + variables86 !! 8.5 ! 02-09 (G. Madec) F90: Free form and module87 !! 9.0 ! 04-10 (C. Ethe) 1D Configuration88 !! " ! 05-11 (V. Garnier) Surface pressure gradient organization89 70 !!---------------------------------------------------------------------- 90 !! * Modules used91 USE ioipsl92 93 !! * Arguments94 71 INTEGER, INTENT( in ) :: kt ! ocean time-step index 95 72 INTEGER, INTENT( in ) :: kindic ! 96 97 !! * Local declarations 98 LOGICAL :: ll_print = .FALSE. ! =T print and flush numout 99 CHARACTER (len=40) :: & 100 clhstnam, clop, clmx ! temporary names 101 INTEGER :: inum = 11 ! temporary logical unit 102 INTEGER :: & 103 ji, jj, ik ! dummy loop indices 104 INTEGER :: & 105 iimi, iima, ipk, it, & ! temporary integers 106 ijmi, ijma ! " " 107 REAL(wp) :: & 108 zsto, zout, zmax, & ! temporary scalars 109 zjulian, zdt ! " " 110 REAL(wp), DIMENSION(jpi,jpj) :: & 111 zw2d ! temporary workspace 73 !! 74 LOGICAL :: ll_print = .FALSE. ! =T print and flush numout 75 CHARACTER (len=40) :: clhstnam, clop, clmx ! temporary names 76 INTEGER :: inum = 11 ! temporary logical unit 77 INTEGER :: ji, jj, ik ! dummy loop indices 78 INTEGER :: iimi, iima, ipk, it, ijmi, ijma ! temporary integers 79 REAL(wp) :: zsto, zout, zmax, zjulian, zdt ! temporary scalars 80 REAL(wp), DIMENSION(jpi,jpj) :: zw2d ! temporary workspace 112 81 !!---------------------------------------------------------------------- 113 82 … … 146 115 ! ----------------------------------------------------------------- 147 116 148 IF(ll_print) WRITE(numout,*) 'dia_wri_ 1d kt = ', kt, ' kindic ', kindic117 IF(ll_print) WRITE(numout,*) 'dia_wri_c1d kt = ', kt, ' kindic ', kindic 149 118 150 119 IF( kt == nit000 ) THEN … … 192 161 CALL histdef( nid_T, "sosaline", "Sea Surface Salinity" , "PSU" , & ! sss 193 162 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 194 195 !!$#if ! defined key_dynspg_rl && ( defined key_lim2 || defined key_lim2 )196 !!$ ! sowaflup = sowaflep + sorunoff + sowafldp + a term associated to197 !!$ ! internal damping to Levitus that can be diagnosed from others198 !!$ ! sowaflcd = sowaflep + sorunoff + sowafldp + iowaflup199 !!$ CALL histdef( nid_T, "iowaflup", "Ice=>ocean net freshwater" , "kg/m2/s", & ! fsalt200 !!$ & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )201 !!$ CALL histdef( nid_T, "sowaflep", "atmos=>ocean net freshwater" , "kg/m2/s", & ! fmass202 !!$ & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )203 !!$#endif204 163 CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux" , "Kg/m2/s", & ! emp 205 164 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 206 207 165 !! CALL histdef( nid_T, "sorunoff", "Runoffs" , "Kg/m2/s", & ! runoffs 166 !! & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 208 167 CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux" , "kg/m2/s", & ! emps 209 168 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) … … 228 187 CALL histdef( nid_T, "soicecov", "Ice Cover" , "[0,1]" , & ! freeze 229 188 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 230 #if ! defined key_coupled 231 CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping" , "W/m2" , & ! qrp 232 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 233 CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping" , "Kg/m2/s", & ! erp 234 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 235 CALL histdef( nid_T, "sosafldp", "Surface salt flux: damping" , "Kg/m2/s", & ! erp * sn 236 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 237 #endif 238 239 #if ( defined key_coupled && ! ( defined key_lim3 || defined key_lim2 ) ) 240 CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping" , "W/m2" , & ! qrp 241 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 242 CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping" , "Kg/m2/s", & ! erp 243 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 244 CALL histdef( nid_T, "sosafldp", "Surface salt flux: Damping" , "Kg/m2/s", & ! erp * sn 245 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 246 #endif 189 IF( ln_ssr ) THEN 190 CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping" , "W/m2" , & ! qrp 191 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 192 CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping" , "Kg/m2/s", & ! erp 193 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 194 CALL histdef( nid_T, "sosafldp", "Surface salt flux: damping" , "Kg/m2/s", & ! erp * sn 195 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 196 ENDIF 247 197 clmx ="l_max(only(x))" ! max index on a period 248 198 CALL histdef( nid_T, "sobowlin", "Bowl Index" , "W-point", & ! bowl INDEX 249 199 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clmx, zsto, zout ) 250 #if defined key_diahth251 CALL histdef( nid_T, "sothedep", "Thermocline Depth" , "m" , & ! hth252 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )253 CALL histdef( nid_T, "so20chgt", "Depth of 20C isotherm" , "m" , & ! hd20254 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )255 CALL histdef( nid_T, "so28chgt", "Depth of 28C isotherm" , "m" , & ! hd28256 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )257 CALL histdef( nid_T, "sohtc300", "Heat content 300 m" , "W" , & ! htc3258 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )259 #endif260 261 #if ( defined key_lim3 || defined key_lim2 ) && defined key_coupled262 CALL histdef( nid_T,"soicetem" , "Ice Surface Temperature" , "K" , & ! tn_ice263 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )264 CALL histdef( nid_T,"soicealb" , "Ice Albedo" , "[0,1]" , & ! alb_ice265 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )266 #endif267 268 200 ! !!! nid_U : 3D 269 201 CALL histdef( nid_T, "vozocrtx", "Zonal Current" , "m/s" , & ! un … … 288 220 & jpi, jpj, nh_T, 1 , 1, 1 , - 99, 32, clop, zsto, zout ) 289 221 #if defined key_zdftke 290 ! !!! nid_W : 3D291 222 CALL histdef( nid_T, "votlsdis", " Dissipation Turbulent Lenght Scale", "m" , & ! e_dis 292 223 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 293 !294 224 CALL histdef( nid_T, "votlsmix", " Mixing Turbulent Lenght Scale" , "m" , & ! e_mix 295 225 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 296 !297 226 CALL histdef( nid_T, "votlspdl", " Prandl Number", "-" , & ! e_pdl 298 227 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 299 !300 228 CALL histdef( nid_T, "votlsric", " Local Richardson Number", "-" , & ! e_ric 301 229 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 302 !303 230 CALL histdef( nid_T, "votkeend", "TKE: Turbulent kinetic energy" , "m2/s" , & ! TKE 304 231 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 305 232 #endif 306 233 #if defined key_zdfkpp 307 ! !!! nid_W : 3D308 234 CALL histdef( nid_T, "vokpprig", " Gradient Richardson Number" , "-" , & ! rig 309 235 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 310 !311 236 CALL histdef( nid_T, "vokpprib", " Bulk Richardson Number " , "-" , & ! rib 312 237 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 313 !314 238 CALL histdef( nid_T, "vokppbsf", " Buoyancy forcing " , "N/m2" , & ! sokppbsf 315 239 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 316 !317 240 CALL histdef( nid_T, "vokppmol", "Moning Obukhov length scale " , "m" , & ! sokppmol 318 241 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) … … 321 244 CALL histdef( nid_T, "voeosbn2", "Brunt-Vaisala Frequency" , "m2/s2" , & ! rn2 322 245 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 323 324 246 CALL histdef( nid_T, "votkeavt", "Vertical Eddy Diffusivity" , "m2/s" , & ! avt 325 247 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 326 327 248 CALL histdef( nid_T, "votkeevd", "Enhanced Vertical Diffusivity", "m2/s" , & ! avt_evd 328 249 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 329 330 250 CALL histdef( nid_T, "votkeavm", "Vertical Eddy Viscosity", "m2/s" , & ! avmu 331 251 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) … … 333 253 CALL histdef( nid_T, "votkeevm", "Enhanced Vertical Viscosity", "m2/s" , & ! avmu_evd 334 254 & jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout ) 335 336 255 IF( lk_zdfddm ) THEN 337 256 CALL histdef( nid_T,"voddmavs","Salt Vertical Eddy Diffusivity" , "m2/s" , & ! avs … … 364 283 CALL histwrite( nid_T, "sosstsst", it, tn(:,:,1) , ndim_hT, ndex_hT ) ! sea surface temperature 365 284 CALL histwrite( nid_T, "sosaline", it, sn(:,:,1) , ndim_hT, ndex_hT ) ! sea surface salinity 366 #if ! defined key_dynspg_rl && ( defined key_lim3 || defined key_lim2 )367 CALL histwrite( nid_T, "iowaflup", it, fsalt(:,:) , ndim_hT, ndex_hT ) ! ice=>ocean water flux368 CALL histwrite( nid_T, "sowaflep", it, fmass(:,:) , ndim_hT, ndex_hT ) ! atmos=>ocean water flux369 #endif370 285 CALL histwrite( nid_T, "sowaflup", it, emp , ndim_hT, ndex_hT ) ! upward water flux 371 286 !! CALL histwrite( nid_T, "sorunoff", it, runoff , ndim_hT, ndex_hT ) ! runoff 372 287 CALL histwrite( nid_T, "sowaflcd", it, emps , ndim_hT, ndex_hT ) ! c/d water flux 373 288 zw2d(:,:) = emps(:,:) * sn(:,:,1) * tmask(:,:,1) … … 390 305 CALL histwrite( nid_T, "somixhgt", it, hmld , ndim_hT, ndex_hT ) ! turbocline depth 391 306 CALL histwrite( nid_T, "soicecov", it, freeze , ndim_hT, ndex_hT ) ! ice cover 392 #if ! defined key_coupled 393 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 394 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 395 zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1) 396 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 397 #endif 398 #if ( defined key_coupled && ! ( defined key_lim3 || defined key_lim2 ) ) 399 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 400 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 307 IF( ln_ssr ) THEN 308 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 309 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 401 310 zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1) 402 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping403 #endif 404 311 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 312 ENDIF 313 zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1) 405 314 CALL histwrite( nid_T, "sobowlin", it, zw2d , ndim_hT, ndex_hT ) ! ??? 406 407 #if defined key_diahth408 CALL histwrite( nid_T, "sothedep", it, hth , ndim_hT, ndex_hT ) ! depth of the thermocline409 CALL histwrite( nid_T, "so20chgt", it, hd20 , ndim_hT, ndex_hT ) ! depth of the 20 isotherm410 CALL histwrite( nid_T, "so28chgt", it, hd28 , ndim_hT, ndex_hT ) ! depth of the 28 isotherm411 CALL histwrite( nid_T, "sohtc300", it, htc3 , ndim_hT, ndex_hT ) ! first 300m heaat content412 #endif413 #if ( defined key_lim3 || defined key_lim2 ) && defined key_coupled414 CALL histwrite( nid_T, "soicetem", it, tn_ice , ndim_hT, ndex_hT ) ! surf. ice temperature415 CALL histwrite( nid_T, "soicealb", it, alb_ice , ndim_hT, ndex_hT ) ! ice albedo416 #endif417 418 315 CALL histwrite( nid_T, "vozocrtx", it, un , ndim_T , ndex_T ) ! i-current 419 316 CALL histwrite( nid_T, "sozotaux", it, utau , ndim_hT, ndex_hT ) ! i-wind stress … … 444 341 ! 3. Synchronise and close all files 445 342 ! --------------------------------------- 446 IF( MOD( kt, nwrite ) == 0 .OR. kindic < 0 ) THEN 447 CALL histsync( nid_T ) 448 ENDIF 343 IF( MOD( kt, nwrite ) == 0 .OR. kindic < 0 ) CALL histsync( nid_T ) 449 344 450 345 ! Create an output files (output.abort.nc) if S < 0 or u > 20 m/s 451 346 IF( kindic < 0 ) CALL dia_wri_state( 'output.abort' ) 452 347 453 IF( kt == nitend .OR. kindic < 0 ) THEN 454 CALL histclo( nid_T ) 455 ENDIF 456 457 END SUBROUTINE dia_wri_1d 348 IF( kt == nitend .OR. kindic < 0 ) CALL histclo( nid_T ) 349 ! 350 END SUBROUTINE dia_wri_c1d 351 458 352 #else 459 353 !!---------------------------------------------------------------------- 460 !! Default key NO 1D Config 354 !! Default key NO 1D Configuration 461 355 !!---------------------------------------------------------------------- 462 356 CONTAINS 463 SUBROUTINE dia_wri_ 1d ( kt, kindic )464 WRITE(*,*) 'dia_wri_ 1d: You should not have seen this print! error?', kt, kindic465 END SUBROUTINE dia_wri_ 1d357 SUBROUTINE dia_wri_c1d ( kt, kindic ) ! dummy routine 358 WRITE(*,*) 'dia_wri_c1d: You should not have seen this print! error?', kt, kindic 359 END SUBROUTINE dia_wri_c1d 466 360 #endif 467 361 468 362 !!====================================================================== 469 END MODULE diawri 1d363 END MODULE diawri_c1d
Note: See TracChangeset
for help on using the changeset viewer.