Changeset 1511 for LMDZ5/trunk/libf/dyn3dpar/grilles_gcm_netcdf_sub.F90
- Timestamp:
- Apr 28, 2011, 5:21:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dyn3dpar/grilles_gcm_netcdf_sub.F90
r1492 r1511 7 7 ! part in the program create_fausse_var. 8 8 ! 9 SUBROUTINE grilles_gcm_netcdf_sub 9 SUBROUTINE grilles_gcm_netcdf_sub(masque,phis) 10 10 11 11 IMPLICIT NONE … … 19 19 INCLUDE "serre.h" 20 20 21 22 REAL,DIMENSION(iip1,jjp1),INTENT(IN) :: masque ! masque terre/mer 23 REAL,DIMENSION(iip1,jjp1),INTENT(IN) :: phis ! geopotentiel au sol 24 21 25 REAL temp(iim+1,jjm+1) 22 26 ! Attributs netcdf sortie 23 27 INTEGER ncid_out,rcode_out 24 INTEGER out_lonuid,out_lonvid,out_latuid,out_latvid 28 INTEGER out_lonuid,out_lonvid,out_latuid,out_latvid,out_levid 25 29 INTEGER out_varid 26 30 INTEGER out_lonudim,out_lonvdim 27 31 INTEGER out_latudim,out_latvdim,out_dim(3) 32 INTEGER out_levdim 28 33 29 34 INTEGER, PARAMETER :: longcles = 20 … … 33 38 34 39 INTEGER status,i,j 35 REAL rlatudeg(jjp1),rlatvdeg(jjm) 40 REAL rlatudeg(jjp1),rlatvdeg(jjm),rlevdeg(llm) 36 41 REAL rlonudeg(iip1),rlonvdeg(iip1) 37 42 38 43 REAL dlon1(iip1),dlon2(iip1),dlat1(jjp1),dlat2(jjp1) 39 44 REAL acoslat,dxkm,dykm,resol(iip1,jjp1) 40 45 REAL,DIMENSION(iip1,jjp1) :: phis_loc 46 INTEGER masque_int(iip1,jjp1) 47 INTEGER :: phis_id 48 INTEGER :: area_id 49 INTEGER :: mask_id 50 41 51 rad = 6400000 42 52 omeg = 7.272205e-05 … … 165 175 #endif 166 176 167 177 ! On re-ouvre le fichier pour rajouter 4 nouvelles variables necessaire pour INCA 178 ! lev - phis - aire - mask 179 rlevdeg(:) = presnivs 180 phis_loc(:,:) = phis(:,:)/g 181 182 ! niveaux de pression verticaux 183 status = NF_REDEF (ncid_out) 184 status=NF_DEF_DIM(ncid_out,'lev',llm,out_levdim) 185 186 ! fields 187 out_dim(1)=out_lonvdim 188 out_dim(2)=out_latudim 189 190 status = nf_def_var(ncid_out,'phis',NF_FLOAT,2,out_dim,phis_id) 191 CALL handle_err(status) 192 status = nf_def_var(ncid_out,'aire',NF_FLOAT,2,out_dim,area_id) 193 CALL handle_err(status) 194 status = nf_def_var(ncid_out,'mask',NF_INT ,2,out_dim,mask_id) 195 CALL handle_err(status) 196 197 status=NF_ENDDEF(ncid_out) 198 199 ! ecriture des variables 200 #ifdef NC_DOUBLE 201 status=NF_PUT_VARA_DOUBLE(ncid_out,out_levid,1,llm,rlevdeg) 202 #else 203 status=NF_PUT_VARA_REAL(ncid_out,out_levid,1,llm,rlevdeg) 204 #endif 205 206 start(1)=1 207 start(2)=1 208 start(3)=1 209 start(4)=0 210 COUNT(1)=iip1 211 COUNT(2)=jjp1 212 COUNT(3)=1 213 COUNT(4)=0 214 215 status = nf_put_vara_double(ncid_out, phis_id,start,count, phis_loc) 216 status = nf_put_vara_double(ncid_out, area_id,start,count, aire) 217 masque_int(:,:) = nINT(masque(:,:)) 218 status = nf_put_vara_int(ncid_out, mask_id,start,count,masque_int) 219 CALL handle_err(status) 220 168 221 ! fermeture du fichier netcdf 169 222 CALL ncclos(ncid_out,rcode_out)
Note: See TracChangeset
for help on using the changeset viewer.