Changeset 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
- Timestamp:
- 2010-12-27T18:33:53+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
- Property svn:eol-style deleted
r1792 r2528 4 4 !! Ocean diagnostics : write ocean output files 5 5 !!===================================================================== 6 7 !!---------------------------------------------------------------------- 8 !! * Modules used 6 !! History : OPA ! 1991-03 (M.-A. Foujols) Original code 7 !! 4.0 ! 1991-11 (G. Madec) 8 !! ! 1992-06 (M. Imbard) correction restart file 9 !! ! 1992-07 (M. Imbard) split into diawri and rstwri 10 !! ! 1993-03 (M. Imbard) suppress writibm 11 !! ! 1998-01 (C. Levy) NETCDF format using ioipsl INTERFACE 12 !! ! 1999-02 (E. Guilyardi) name of netCDF files + variables 13 !! 8.2 ! 2000-06 (M. Imbard) Original code (diabort.F) 14 !! NEMO 1.0 ! 2002-06 (A.Bozec, E. Durand) Original code (diainit.F) 15 !! - ! 2002-09 (G. Madec) F90: Free form and module 16 !! - ! 2002-12 (G. Madec) merge of diabort and diainit, F90 17 !! ! 2005-11 (V. Garnier) Surface pressure gradient organization 18 !! 3.2 ! 2008-11 (B. Lemaire) creation from old diawri 19 !!---------------------------------------------------------------------- 20 21 !!---------------------------------------------------------------------- 22 !! dia_wri : create the standart output files 23 !! dia_wri_state : create an output NetCDF file for a single instantaeous ocean state and forcing fields 24 !!---------------------------------------------------------------------- 9 25 USE oce ! ocean dynamics and tracers 10 26 USE dom_oce ! ocean space and time domain … … 30 46 USE limwri_2 31 47 #endif 48 USE dtatem 49 USE dtasal 50 32 51 IMPLICIT NONE 33 52 PRIVATE 34 53 35 !! * Accessibility 36 PUBLIC dia_wri ! routines called by step.F90 37 PUBLIC dia_wri_state 38 39 !! * Module variables 40 INTEGER :: & 41 nid_T, nz_T, nh_T, ndim_T, ndim_hT, & ! grid_T file 42 nid_U, nz_U, nh_U, ndim_U, ndim_hU, & ! grid_U file 43 nid_V, nz_V, nh_V, ndim_V, ndim_hV, & ! grid_V file 44 nid_W, nz_W, nh_W, & ! grid_W file 45 ndex(1) ! ??? 46 INTEGER, DIMENSION(jpi*jpj) :: & 47 ndex_hT, ndex_hU, ndex_hV 48 INTEGER, DIMENSION(jpi*jpj*jpk) :: & 49 ndex_T, ndex_U, ndex_V 54 PUBLIC dia_wri ! routines called by step.F90 55 PUBLIC dia_wri_state 56 57 INTEGER :: nid_T, nz_T, nh_T, ndim_T, ndim_hT ! grid_T file 58 INTEGER :: nid_U, nz_U, nh_U, ndim_U, ndim_hU ! grid_U file 59 INTEGER :: nid_V, nz_V, nh_V, ndim_V, ndim_hV ! grid_V file 60 INTEGER :: nid_W, nz_W, nh_W ! grid_W file 61 INTEGER :: ndex(1) ! ??? 62 INTEGER, DIMENSION(jpi*jpj) :: ndex_hT, ndex_hU, ndex_hV 63 INTEGER, DIMENSION(jpi*jpj*jpk) :: ndex_T, ndex_U, ndex_V 50 64 51 65 !! * Substitutions … … 54 68 # include "vectopt_loop_substitute.h90" 55 69 !!---------------------------------------------------------------------- 56 !! OPA 9.0 , LOCEAN-IPSL (2005) 57 !! $Id$ 58 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 59 !!---------------------------------------------------------------------- 60 70 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 71 !! $Id $ 72 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 73 !!---------------------------------------------------------------------- 61 74 CONTAINS 62 75 63 76 #if defined key_dimgout 64 77 !!---------------------------------------------------------------------- 65 !! dia_wri : create the dimg direct access output file (mpp)78 !! 'key_dimgout' DIMG output file 66 79 !!---------------------------------------------------------------------- 67 80 # include "diawri_dimg.h90" … … 71 84 !! Default option NetCDF output file 72 85 !!---------------------------------------------------------------------- 73 !! dia_wri : create the standart NetCDF output files74 !! dia_wri_state : create an output NetCDF file for a single75 !! instantaeous ocean state and forcing fields76 !!----------------------------------------------------------------------77 86 # if defined key_iomput 87 !!---------------------------------------------------------------------- 88 !! 'key_iomput' use IOM library 89 !!---------------------------------------------------------------------- 78 90 SUBROUTINE dia_wri( kt ) 79 91 !!--------------------------------------------------------------------- … … 84 96 !! 85 97 !! ** Method : use iom_put 86 !!87 !! History :88 !! 3.2 ! 05-11 (B. Lemaire) creation from old diawri89 98 !!---------------------------------------------------------------------- 90 99 USE oce, ONLY : z3d => ta ! use ta as 3D workspace … … 165 174 CALL iom_put( "v_heattr", z2d ) ! heat transport in i-direction 166 175 ENDIF 167 176 ! 168 177 END SUBROUTINE dia_wri 169 178 170 179 #else 180 !!---------------------------------------------------------------------- 181 !! Default option use IOIPSL library 182 !!---------------------------------------------------------------------- 183 171 184 SUBROUTINE dia_wri( kt ) 172 185 !!--------------------------------------------------------------------- … … 180 193 !! At each time step call histdef to compute the mean if ncessary 181 194 !! Each nwrite time step, output the instantaneous or mean fields 195 !!---------------------------------------------------------------------- 196 INTEGER, INTENT( in ) :: kt ! ocean time-step index 182 197 !! 183 !! History : 184 !! ! 91-03 (M.-A. Foujols) Original code 185 !! ! 91-11 (G. Madec) 186 !! ! 92-06 (M. Imbard) correction restart file 187 !! ! 92-07 (M. Imbard) split into diawri and rstwri 188 !! ! 93-03 (M. Imbard) suppress writibm 189 !! ! 98-01 (C. Levy) NETCDF format using ioipsl INTERFACE 190 !! ! 99-02 (E. Guilyardi) name of netCDF files + variables 191 !! 8.5 ! 02-09 (G. Madec) F90: Free form and module 192 !! 9.0 ! 05-11 (V. Garnier) Surface pressure gradient organization 193 !!---------------------------------------------------------------------- 194 !! * Arguments 195 INTEGER, INTENT( in ) :: kt ! ocean time-step index 196 197 !! * Local declarations 198 LOGICAL :: ll_print = .FALSE. ! =T print and flush numout 199 CHARACTER (len=40) :: & 200 clhstnam, clop, clmx ! temporary names 201 INTEGER :: inum = 11 ! temporary logical unit 202 INTEGER :: & 203 iimi, iima, ipk, it, itmod, & ! temporary integers 204 ijmi, ijma ! " " 205 REAL(wp) :: & 206 zsto, zout, zmax, & ! temporary scalars 207 zjulian, zdt ! " " 208 REAL(wp), DIMENSION(jpi,jpj) :: & 209 zw2d ! temporary workspace 198 LOGICAL :: ll_print = .FALSE. ! =T print and flush numout 199 CHARACTER (len=40) :: clhstnam, clop, clmx ! local names 200 INTEGER :: inum = 11 ! temporary logical unit 201 INTEGER :: iimi, iima, ipk, it, itmod, ijmi, ijma ! local integers 202 REAL(wp) :: zsto, zout, zmax, zjulian, zdt ! local scalars 203 REAL(wp), DIMENSION(jpi,jpj) :: zw2d ! 2D workspace 210 204 !!---------------------------------------------------------------------- 211 205 ! … … 279 273 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & ! Horizontal grid: glamt and gphit 280 274 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 281 & nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom )275 & nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom, snc4chunks=snc4set ) 282 276 CALL histvert( nid_T, "deptht", "Vertical T levels", & ! Vertical grid: gdept 283 277 & "m", ipk, gdept_0, nz_T, "down" ) … … 292 286 CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu, & ! Horizontal grid: glamu and gphiu 293 287 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 294 & nit000-1, zjulian, zdt, nh_U, nid_U, domain_id=nidom )288 & nit000-1, zjulian, zdt, nh_U, nid_U, domain_id=nidom, snc4chunks=snc4set ) 295 289 CALL histvert( nid_U, "depthu", "Vertical U levels", & ! Vertical grid: gdept 296 290 & "m", ipk, gdept_0, nz_U, "down" ) … … 305 299 CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv, & ! Horizontal grid: glamv and gphiv 306 300 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 307 & nit000-1, zjulian, zdt, nh_V, nid_V, domain_id=nidom )301 & nit000-1, zjulian, zdt, nh_V, nid_V, domain_id=nidom, snc4chunks=snc4set ) 308 302 CALL histvert( nid_V, "depthv", "Vertical V levels", & ! Vertical grid : gdept 309 303 & "m", ipk, gdept_0, nz_V, "down" ) … … 318 312 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & ! Horizontal grid: glamt and gphit 319 313 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 320 & nit000-1, zjulian, zdt, nh_W, nid_W, domain_id=nidom )314 & nit000-1, zjulian, zdt, nh_W, nid_W, domain_id=nidom, snc4chunks=snc4set ) 321 315 CALL histvert( nid_W, "depthw", "Vertical W levels", & ! Vertical grid: gdepw 322 316 & "m", ipk, gdepw_0, nz_W, "down" ) … … 346 340 !!$ & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 347 341 !!$#endif 348 CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux" , "Kg/m2/s", & ! emp342 CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux" , "Kg/m2/s", & ! (emp-rnf) 349 343 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 350 344 !!$ CALL histdef( nid_T, "sorunoff", "Runoffs" , "Kg/m2/s", & ! runoffs 351 345 !!$ & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 352 CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux" , "kg/m2/s", & ! emps353 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 354 CALL histdef( nid_T, "sosalflx", "Surface Salt Flux" , "Kg/m2/s", & ! emps* sn346 CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux" , "kg/m2/s", & ! (emps-rnf) 347 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 348 CALL histdef( nid_T, "sosalflx", "Surface Salt Flux" , "Kg/m2/s", & ! (emps-rnf) * sn 355 349 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 356 350 CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux" , "W/m2" , & ! qns + qsr … … 383 377 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 384 378 CALL histdef( nid_T, "sosafldp", "Surface salt flux: Damping" , "Kg/m2/s", & ! erp * sn 385 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout )386 #endif387 #if defined key_diaspr388 CALL histdef( nid_T, "sosurfps", "Surface Pressure" , "cm" , & ! sp389 379 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 390 380 #endif … … 414 404 #endif 415 405 416 CALL histend( nid_T )406 CALL histend( nid_T, snc4chunks=snc4set ) 417 407 418 408 ! !!! nid_U : 3D … … 427 417 & jpi, jpj, nh_U, 1 , 1, 1 , - 99, 32, clop, zsto, zout ) 428 418 429 CALL histend( nid_U )419 CALL histend( nid_U, snc4chunks=snc4set ) 430 420 431 421 ! !!! nid_V : 3D … … 440 430 & jpi, jpj, nh_V, 1 , 1, 1 , - 99, 32, clop, zsto, zout ) 441 431 442 CALL histend( nid_V )432 CALL histend( nid_V, snc4chunks=snc4set ) 443 433 444 434 ! !!! nid_W : 3D … … 468 458 #endif 469 459 470 CALL histend( nid_W )460 CALL histend( nid_W, snc4chunks=snc4set ) 471 461 472 462 IF(lwp) WRITE(numout,*) … … 498 488 !!$ CALL histwrite( nid_T, "sowaflep", it, fmass(:,:) , ndim_hT, ndex_hT ) ! atmos=>ocean water flux 499 489 !!$#endif 500 CALL histwrite( nid_T, "sowaflup", it, emp, ndim_hT, ndex_hT ) ! upward water flux490 CALL histwrite( nid_T, "sowaflup", it, ( emp-rnf ) , ndim_hT, ndex_hT ) ! upward water flux 501 491 !!$ CALL histwrite( nid_T, "sorunoff", it, runoff , ndim_hT, ndex_hT ) ! runoff 502 CALL histwrite( nid_T, "sowaflcd", it, emps, ndim_hT, ndex_hT ) ! c/d water flux503 zw2d(:,:) = emps(:,:) * sn(:,:,1) * tmask(:,:,1)492 CALL histwrite( nid_T, "sowaflcd", it, ( emps-rnf ) , ndim_hT, ndex_hT ) ! c/d water flux 493 zw2d(:,:) = ( emps(:,:) - rnf(:,:) ) * sn(:,:,1) * tmask(:,:,1) 504 494 CALL histwrite( nid_T, "sosalflx", it, zw2d , ndim_hT, ndex_hT ) ! c/d salt flux 505 495 CALL histwrite( nid_T, "sohefldo", it, qns + qsr , ndim_hT, ndex_hT ) ! total heat flux … … 521 511 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 522 512 #endif 523 #if defined key_diaspr 524 CALL histwrite( nid_T, "sosurfps", it, gps , ndim_hT, ndex_hT ) ! surface pressure 525 #endif 526 zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1) 513 zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1) 527 514 CALL histwrite( nid_T, "sobowlin", it, zw2d , ndim_hT, ndex_hT ) ! ??? 528 515 … … 583 570 CALL histclo( nid_W ) 584 571 ENDIF 585 572 ! 586 573 END SUBROUTINE dia_wri 587 574 # endif … … 601 588 !! File 'output.init.nc' is created if ninist = 1 (namelist) 602 589 !! File 'output.abort.nc' is created in case of abnormal job end 603 !!604 !! History :605 !! 8.2 ! 00-06 (M. Imbard) Original code (diabort.F)606 !! 8.5 ! 02-06 (A.Bozec, E. Durand) Original code (diainit.F)607 !! 9.0 ! 02-12 (G. Madec) merge of diabort and diainit, F90608 !! " ! 05-11 (V. Garnier) Surface pressure gradient organization609 590 !!---------------------------------------------------------------------- 610 !! * Arguments611 591 CHARACTER (len=* ), INTENT( in ) :: cdfile_name ! name of the file created 612 592 INTEGER , INTENT( in ) :: kt ! ocean time-step index 613 614 !! * Local declarations 593 !! 615 594 CHARACTER (len=32) :: clname 616 595 CHARACTER (len=40) :: clop 617 INTEGER :: & 618 id_i , nz_i, nh_i 619 INTEGER, DIMENSION(1) :: & 620 idex ! temprary workspace 621 REAL(wp) :: & 622 zsto, zout, zmax, & 623 zjulian, zdt 596 INTEGER :: id_i , nz_i, nh_i 597 INTEGER, DIMENSION(1) :: idex ! local workspace 598 REAL(wp) :: zsto, zout, zmax, zjulian, zdt 624 599 !!---------------------------------------------------------------------- 625 600 … … 649 624 zjulian = zjulian - adatrj ! set calendar origin to the beginning of the experiment 650 625 CALL histbeg( clname, jpi, glamt, jpj, gphit, & 651 1, jpi, 1, jpj, nit000-1, zjulian, zdt, nh_i, id_i, domain_id=nidom )! Horizontal grid : glamt and gphit626 1, jpi, 1, jpj, nit000-1, zjulian, zdt, nh_i, id_i, domain_id=nidom, snc4chunks=snc4set ) ! Horizontal grid : glamt and gphit 652 627 CALL histvert( id_i, "deptht", "Vertical T levels", & ! Vertical grid : gdept 653 628 "m", jpk, gdept_0, nz_i, "down") … … 683 658 CALL lim_wri_state_2( kt, id_i, nh_i ) 684 659 #else 685 CALL histend( id_i )660 CALL histend( id_i, snc4chunks=snc4set ) 686 661 #endif 687 662 … … 700 675 CALL histwrite( id_i, "vomecrty", kt, vn , jpi*jpj*jpk, idex ) ! now j-velocity 701 676 CALL histwrite( id_i, "vovecrtz", kt, wn , jpi*jpj*jpk, idex ) ! now k-velocity 702 CALL histwrite( id_i, "sowaflup", kt, emp, jpi*jpj , idex ) ! freshwater budget677 CALL histwrite( id_i, "sowaflup", kt, (emp-rnf), jpi*jpj , idex ) ! freshwater budget 703 678 CALL histwrite( id_i, "sohefldo", kt, qsr + qns, jpi*jpj , idex ) ! total heat flux 704 679 CALL histwrite( id_i, "soshfldo", kt, qsr , jpi*jpj , idex ) ! solar heat flux
Note: See TracChangeset
for help on using the changeset viewer.