- Timestamp:
- 2011-06-27T13:18:25+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
r2715 r2789 46 46 USE limwri_2 47 47 #endif 48 USE dtatem49 USE dtasal50 48 USE lib_mpp ! MPP library 51 49 … … 116 114 !! ** Method : use iom_put 117 115 !!---------------------------------------------------------------------- 118 USE oce, ONLY : z3d => ta ! use ta as 3D workspace119 116 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 117 USE wrk_nemo, ONLY: z3d => wrk_3d_1 120 118 USE wrk_nemo, ONLY: z2d => wrk_2d_1 121 119 !! … … 126 124 !!---------------------------------------------------------------------- 127 125 ! 128 IF( wrk_in_use(2, 1))THEN 129 CALL ctl_stop('dia_wri: ERROR - requested 2D workspace unavailable.') 130 RETURN 126 IF( wrk_in_use(3, 1) .OR. wrk_in_use(2, 1) ) THEN 127 CALL ctl_stop('dia_wri: ERROR - requested 2D workspace unavailable.') ; RETURN 131 128 END IF 132 129 ! … … 137 134 ENDIF 138 135 139 CALL iom_put( "toce" , t n) ! temperature140 CALL iom_put( "soce" , sn) ! salinity141 CALL iom_put( "sst" , t n(:,:,1)) ! sea surface temperature142 CALL iom_put( "sst2" , t n(:,:,1) * tn(:,:,1) ) ! square of sea surface temperature143 CALL iom_put( "sss" , sn(:,:,1)) ! sea surface salinity144 CALL iom_put( "sss2" , sn(:,:,1) * sn(:,:,1) ) ! square of sea surface salinity145 CALL iom_put( "uoce" , un ) ! i-current146 CALL iom_put( "voce" , vn ) ! j-current136 CALL iom_put( "toce" , tsn(:,:,:,jp_tem) ) ! temperature 137 CALL iom_put( "soce" , tsn(:,:,:,jp_sal) ) ! salinity 138 CALL iom_put( "sst" , tsn(:,:,1,jp_tem) ) ! sea surface temperature 139 CALL iom_put( "sst2" , tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) ) ! square of sea surface temperature 140 CALL iom_put( "sss" , tsn(:,:,1,jp_sal) ) ! sea surface salinity 141 CALL iom_put( "sss2" , tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) ) ! square of sea surface salinity 142 CALL iom_put( "uoce" , un ) ! i-current 143 CALL iom_put( "voce" , vn ) ! j-current 147 144 148 CALL iom_put( "avt" , avt ) ! T vert. eddy diff. coef.149 CALL iom_put( "avm" , avmu ) ! T vert. eddy visc. coef.145 CALL iom_put( "avt" , avt ) ! T vert. eddy diff. coef. 146 CALL iom_put( "avm" , avmu ) ! T vert. eddy visc. coef. 150 147 IF( lk_zdfddm ) THEN 151 CALL iom_put( "avs" , fsavs(:,:,:) ) ! S vert. eddy diff. coef.148 CALL iom_put( "avs" , fsavs(:,:,:) ) ! S vert. eddy diff. coef. 152 149 ENDIF 153 150 154 151 DO jj = 2, jpjm1 ! sst gradient 155 152 DO ji = fs_2, fs_jpim1 ! vector opt. 156 zztmp = t n(ji,jj,1)157 zztmpx = ( t n(ji+1,jj ,1) - zztmp ) / e1u(ji,jj) + ( zztmp - tn(ji-1,jj ,1) ) / e1u(ji-1,jj )158 zztmpy = ( t n(ji ,jj+1,1) - zztmp ) / e2v(ji,jj) + ( zztmp - tn(ji ,jj-1,1) ) / e2v(ji ,jj-1)153 zztmp = tsn(ji,jj,1,jp_tem) 154 zztmpx = ( tsn(ji+1,jj ,1,jp_tem) - zztmp ) / e1u(ji,jj) + ( zztmp - tsn(ji-1,jj ,1,jp_tem) ) / e1u(ji-1,jj ) 155 zztmpy = ( tsn(ji ,jj+1,1,jp_tem) - zztmp ) / e2v(ji,jj) + ( zztmp - tsn(ji ,jj-1,1,jp_tem) ) / e2v(ji ,jj-1) 159 156 z2d(ji,jj) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy ) & 160 157 & * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * umask(ji,jj-1,1) … … 178 175 DO jj = 2, jpjm1 179 176 DO ji = fs_2, fs_jpim1 ! vector opt. 180 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * zztmp * ( t n(ji,jj,jk) + tn(ji+1,jj,jk) )177 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * zztmp * ( tsn(ji,jj,jk,jp_tem) + tsn(ji+1,jj,jk,jp_tem) ) 181 178 END DO 182 179 END DO … … 192 189 DO jj = 2, jpjm1 193 190 DO ji = fs_2, fs_jpim1 ! vector opt. 194 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * zztmp * ( t n(ji,jj,jk) + tn(ji,jj+1,jk) )191 z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * zztmp * ( tsn(ji,jj,jk,jp_tem) + tsn(ji,jj+1,jk,jp_tem) ) 195 192 END DO 196 193 END DO … … 200 197 ENDIF 201 198 ! 202 IF( wrk_not_released( 2, 1))THEN199 IF( wrk_not_released(3, 1) .OR. wrk_not_released(2, 1) ) THEN 203 200 CALL ctl_stop('dia_wri: ERROR - failed to release 2D workspace.') 204 201 RETURN … … 516 513 517 514 ! Write fields on T grid 518 CALL histwrite( nid_T, "votemper", it, t n, ndim_T , ndex_T ) ! temperature519 CALL histwrite( nid_T, "vosaline", it, sn, ndim_T , ndex_T ) ! salinity520 CALL histwrite( nid_T, "sosstsst", it, t n(:,:,1), ndim_hT, ndex_hT ) ! sea surface temperature521 CALL histwrite( nid_T, "sosaline", it, sn(:,:,1), ndim_hT, ndex_hT ) ! sea surface salinity515 CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem), ndim_T , ndex_T ) ! temperature 516 CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal), ndim_T , ndex_T ) ! salinity 517 CALL histwrite( nid_T, "sosstsst", it, tsn(:,:,1,jp_tem), ndim_hT, ndex_hT ) ! sea surface temperature 518 CALL histwrite( nid_T, "sosaline", it, tsn(:,:,1,jp_sal), ndim_hT, ndex_hT ) ! sea surface salinity 522 519 CALL histwrite( nid_T, "sossheig", it, sshn , ndim_hT, ndex_hT ) ! sea surface height 523 520 !!$#if defined key_lim3 || defined key_lim2 … … 528 525 !!$ CALL histwrite( nid_T, "sorunoff", it, runoff , ndim_hT, ndex_hT ) ! runoff 529 526 CALL histwrite( nid_T, "sowaflcd", it, ( emps-rnf ) , ndim_hT, ndex_hT ) ! c/d water flux 530 zw2d(:,:) = ( emps(:,:) - rnf(:,:) ) * sn(:,:,1) * tmask(:,:,1)527 zw2d(:,:) = ( emps(:,:) - rnf(:,:) ) * tsn(:,:,1,jp_sal) * tmask(:,:,1) 531 528 CALL histwrite( nid_T, "sosalflx", it, zw2d , ndim_hT, ndex_hT ) ! c/d salt flux 532 529 CALL histwrite( nid_T, "sohefldo", it, qns + qsr , ndim_hT, ndex_hT ) ! total heat flux … … 539 536 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 540 537 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 541 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)538 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1) 542 539 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 543 540 #endif … … 545 542 CALL histwrite( nid_T, "sohefldp", it, qrp , ndim_hT, ndex_hT ) ! heat flux damping 546 543 CALL histwrite( nid_T, "sowafldp", it, erp , ndim_hT, ndex_hT ) ! freshwater flux damping 547 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)544 IF( ln_ssr ) zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1) 548 545 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 549 546 #endif … … 711 708 712 709 ! Write all fields on T grid 713 CALL histwrite( id_i, "votemper", kt, t n, jpi*jpj*jpk, idex ) ! now temperature714 CALL histwrite( id_i, "vosaline", kt, sn, jpi*jpj*jpk, idex ) ! now salinity715 CALL histwrite( id_i, "sossheig", kt, sshn , jpi*jpj , idex ) ! sea surface height716 CALL histwrite( id_i, "vozocrtx", kt, un , jpi*jpj*jpk, idex ) ! now i-velocity717 CALL histwrite( id_i, "vomecrty", kt, vn , jpi*jpj*jpk, idex ) ! now j-velocity718 CALL histwrite( id_i, "vovecrtz", kt, wn , jpi*jpj*jpk, idex ) ! now k-velocity719 CALL histwrite( id_i, "sowaflup", kt, (emp-rnf ), jpi*jpj , idex ) ! freshwater budget720 CALL histwrite( id_i, "sohefldo", kt, qsr + qns , jpi*jpj , idex ) ! total heat flux721 CALL histwrite( id_i, "soshfldo", kt, qsr , jpi*jpj , idex ) ! solar heat flux722 CALL histwrite( id_i, "soicecov", kt, fr_i , jpi*jpj , idex ) ! ice fraction723 CALL histwrite( id_i, "sozotaux", kt, utau , jpi*jpj , idex ) ! i-wind stress724 CALL histwrite( id_i, "sometauy", kt, vtau , jpi*jpj , idex ) ! j-wind stress710 CALL histwrite( id_i, "votemper", kt, tsn(:,:,:,jp_tem), jpi*jpj*jpk, idex ) ! now temperature 711 CALL histwrite( id_i, "vosaline", kt, tsn(:,:,:,jp_sal), jpi*jpj*jpk, idex ) ! now salinity 712 CALL histwrite( id_i, "sossheig", kt, sshn , jpi*jpj , idex ) ! sea surface height 713 CALL histwrite( id_i, "vozocrtx", kt, un , jpi*jpj*jpk, idex ) ! now i-velocity 714 CALL histwrite( id_i, "vomecrty", kt, vn , jpi*jpj*jpk, idex ) ! now j-velocity 715 CALL histwrite( id_i, "vovecrtz", kt, wn , jpi*jpj*jpk, idex ) ! now k-velocity 716 CALL histwrite( id_i, "sowaflup", kt, (emp-rnf ) , jpi*jpj , idex ) ! freshwater budget 717 CALL histwrite( id_i, "sohefldo", kt, qsr + qns , jpi*jpj , idex ) ! total heat flux 718 CALL histwrite( id_i, "soshfldo", kt, qsr , jpi*jpj , idex ) ! solar heat flux 719 CALL histwrite( id_i, "soicecov", kt, fr_i , jpi*jpj , idex ) ! ice fraction 720 CALL histwrite( id_i, "sozotaux", kt, utau , jpi*jpj , idex ) ! i-wind stress 721 CALL histwrite( id_i, "sometauy", kt, vtau , jpi*jpj , idex ) ! j-wind stress 725 722 726 723 ! 3. Close the file
Note: See TracChangeset
for help on using the changeset viewer.