Changeset 2715 for trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
- Timestamp:
- 2011-03-30T17:58:35+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
r2561 r2715 48 48 USE dtatem 49 49 USE dtasal 50 USE lib_mpp ! MPP library 50 51 51 52 IMPLICIT NONE … … 54 55 PUBLIC dia_wri ! routines called by step.F90 55 56 PUBLIC dia_wri_state 57 PUBLIC dia_wri_alloc ! Called by nemogcm module 56 58 57 59 INTEGER :: nid_T, nz_T, nh_T, ndim_T, ndim_hT ! grid_T file … … 60 62 INTEGER :: nid_W, nz_W, nh_W ! grid_W file 61 63 INTEGER :: ndex(1) ! ??? 62 INTEGER, DIMENSION(jpi*jpj) ::ndex_hT, ndex_hU, ndex_hV63 INTEGER, DIMENSION(jpi*jpj*jpk) ::ndex_T, ndex_U, ndex_V64 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hT, ndex_hU, ndex_hV 65 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_T, ndex_U, ndex_V 64 66 65 67 !! * Substitutions … … 74 76 CONTAINS 75 77 78 INTEGER FUNCTION dia_wri_alloc() 79 !!---------------------------------------------------------------------- 80 INTEGER, DIMENSION(2) :: ierr 81 !!---------------------------------------------------------------------- 82 ! 83 ierr = 0 84 ! 85 ALLOCATE( ndex_hT(jpi*jpj) , ndex_T(jpi*jpj*jpk) , & 86 & ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) , & 87 & ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 88 ! 89 dia_wri_alloc = MAXVAL(ierr) 90 IF( lk_mpp ) CALL mpp_sum( dia_wri_alloc ) 91 ! 92 END FUNCTION dia_wri_alloc 93 76 94 #if defined key_dimgout 77 95 !!---------------------------------------------------------------------- … … 88 106 !! 'key_iomput' use IOM library 89 107 !!---------------------------------------------------------------------- 108 90 109 SUBROUTINE dia_wri( kt ) 91 110 !!--------------------------------------------------------------------- … … 98 117 !!---------------------------------------------------------------------- 99 118 USE oce, ONLY : z3d => ta ! use ta as 3D workspace 119 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 120 USE wrk_nemo, ONLY: z2d => wrk_2d_1 100 121 !! 101 122 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 103 124 INTEGER :: ji, jj, jk ! dummy loop indices 104 125 REAL(wp) :: zztmp, zztmpx, zztmpy ! 105 REAL(wp), DIMENSION(jpi,jpj) :: z2d !106 126 !!---------------------------------------------------------------------- 107 127 ! 128 IF( wrk_in_use(2, 1))THEN 129 CALL ctl_stop('dia_wri: ERROR - requested 2D workspace unavailable.') 130 RETURN 131 END IF 132 ! 108 133 ! Output the initial state and forcings 109 134 IF( ninist == 1 ) THEN … … 175 200 ENDIF 176 201 ! 202 IF( wrk_not_released(2, 1))THEN 203 CALL ctl_stop('dia_wri: ERROR - failed to release 2D workspace.') 204 RETURN 205 END IF 206 ! 177 207 END SUBROUTINE dia_wri 178 208 … … 194 224 !! Each nwrite time step, output the instantaneous or mean fields 195 225 !!---------------------------------------------------------------------- 226 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 227 USE wrk_nemo, ONLY: zw2d => wrk_2d_1 228 !! 196 229 INTEGER, INTENT( in ) :: kt ! ocean time-step index 197 230 !! … … 201 234 INTEGER :: iimi, iima, ipk, it, itmod, ijmi, ijma ! local integers 202 235 REAL(wp) :: zsto, zout, zmax, zjulian, zdt ! local scalars 203 REAL(wp), DIMENSION(jpi,jpj) :: zw2d ! 2D workspace204 236 !!---------------------------------------------------------------------- 237 ! 238 IF( wrk_in_use(2, 1))THEN 239 CALL ctl_stop('dia_wri: ERROR - requested 2D workspace unavailable.') 240 RETURN 241 END IF 205 242 ! 206 243 ! Output the initial state and forcings … … 502 539 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 503 540 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 504 zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)541 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1) 505 542 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 506 543 #endif … … 508 545 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 509 546 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 510 zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)547 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1) 511 548 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 512 549 #endif … … 570 607 CALL histclo( nid_W ) 571 608 ENDIF 609 ! 610 IF( wrk_not_released(2, 1))THEN 611 CALL ctl_stop('dia_wri: ERROR - failed to release 2D workspace.') 612 RETURN 613 END IF 572 614 ! 573 615 END SUBROUTINE dia_wri
Note: See TracChangeset
for help on using the changeset viewer.