Changeset 1531 for trunk/LMDZ.GENERIC
- Timestamp:
- Apr 7, 2016, 9:17:30 AM (9 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r1529 r1531 1163 1163 on the global dynamics grid. 1164 1164 As before, the slab ocean only works in serial. 1165 1166 == 07/04/2016 == EM+MT 1167 - Fix buggy ouputs in 1D introduced by previous code modifications. -
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F
r1529 r1531 21 21 & mugaz, rcp, omeg 22 22 use time_phylmdz_mod, only: daysec, dtphys, day_step, ecritphy, 23 & nday 23 & nday, iphysiq 24 24 use callkeys_mod, only: tracer,check_cpp_match,rings_shadow, 25 25 & specOLR,water,pceil,ok_slab_ocean 26 26 USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff 27 27 USE logic_mod, ONLY: hybrid,autozlevs 28 use regular_lonlat_mod, only: init_regular_lonlat 29 use planete_mod, only: ini_planete_mod 28 30 use inifis_mod, only: inifis 29 31 implicit none … … 478 480 write(*,*) " day_step = ",day_step 479 481 480 482 iphysiq=1 ! in 1D model physics are called evry time step 481 483 ecritphy=day_step ! default value for ecritphy 482 484 PRINT *,'Nunber of steps between writediagfi ?' … … 497 499 write(*,*)"-------------------------------------" 498 500 write(*,*)"-------------------------------------" 501 502 ! initializations, as with iniphysiq.F90 for the 3D GCM 503 CALL init_regular_lonlat(1,1,longitude,latitude, 504 & (/0.,0./),(/0.,0./)) 505 506 call ini_planete_mod(nlayer,preff,ap,bp) 499 507 500 508 !!! CALL INIFIS -
trunk/LMDZ.GENERIC/libf/phystd/inistats.F
r1529 r1531 16 16 integer :: l,nsteppd 17 17 real, dimension(nbp_lev) :: sig_s 18 real :: lon_reg_ext(nbp_lon+1) ! extended longitudes18 real,allocatable :: lon_reg_ext(:) ! extended longitudes 19 19 integer :: idim_lat,idim_lon,idim_llm,idim_llmp1,idim_time 20 20 real, dimension(istime) :: lt 21 21 integer :: nvarid 22 22 23 24 IF (nbp_lon*nbp_lat==1) THEN 25 ! 1D model 26 ALLOCATE(lon_reg_ext(1)) 27 ELSE 28 ! 3D model 29 ALLOCATE(lon_reg_ext(nbp_lon+1)) 30 ENDIF 31 23 32 write (*,*) 24 33 write (*,*) ' || STATS ||' … … 46 55 47 56 lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon) 48 !add extra redundant point (180 degrees, since lon_reg starts at -180 49 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 57 IF (nbp_lon*nbp_lat/=1) THEN 58 ! In 3D, add extra redundant point (180 degrees, 59 ! since lon_reg starts at -180) 60 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 61 ENDIF 50 62 51 63 if (is_master) then … … 59 71 60 72 ierr = NF_DEF_DIM (nid, "latitude", nbp_lat, idim_lat) 61 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_lon) 73 IF (nbp_lon*nbp_lat==1) THEN 74 ierr = NF_DEF_DIM (nid, "longitude", 1, idim_lon) 75 ELSE 76 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_lon) 77 ENDIF 62 78 ierr = NF_DEF_DIM (nid, "altitude", nbp_lev, idim_llm) 63 79 ierr = NF_DEF_DIM (nid, "llmp1", nbp_lev+1, idim_llmp1) -
trunk/LMDZ.GENERIC/libf/phystd/iniwrite.F
r1529 r1531 1 SUBROUTINE iniwrite(nid,idayref,phis,area )1 SUBROUTINE iniwrite(nid,idayref,phis,area,nbplon,nbplat) 2 2 3 3 use comsoil_h, only: mlayer, nsoilmx … … 35 35 integer,intent(in) :: nid ! NetCDF file ID 36 36 INTEGER*4,intent(in) :: idayref ! date (initial date for this run) 37 real,intent(in) :: phis(nbp_lon+1,nbp_lat) ! surface geopotential 38 real,intent(in) :: area(nbp_lon+1,nbp_lat) ! mesh area (m2) 37 real,intent(in) :: phis(nbplon,nbp_lat) ! surface geopotential 38 real,intent(in) :: area(nbplon,nbp_lat) ! mesh area (m2) 39 integer,intent(in) :: nbplon,nbplat ! sizes of area and phis arrays 39 40 40 41 c Local: … … 44 45 REAL tab_cntrl(length) ! run parameters are stored in this array 45 46 INTEGER ierr 46 REAl :: lon_reg_ext(nbp_lon+1) ! extended longitudes47 REAl,ALLOCATABLE :: lon_reg_ext(:) ! extended longitudes 47 48 48 49 integer :: nvarid,idim_index,idim_rlonv … … 51 52 integer, dimension(2) :: id 52 53 c----------------------------------------------------------------------- 54 55 IF (nbp_lon*nbp_lat==1) THEN 56 ! 1D model 57 ALLOCATE(lon_reg_ext(1)) 58 ELSE 59 ! 3D model 60 ALLOCATE(lon_reg_ext(nbp_lon+1)) 61 ENDIF 53 62 54 63 DO l=1,length … … 102 111 ! ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 103 112 ierr = NF_DEF_DIM (nid, "latitude", nbp_lat, idim_rlatu) 104 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv) 113 IF (nbp_lon*nbp_lat==1) THEN 114 ierr = NF_DEF_DIM (nid, "longitude", 1, idim_rlonv) 115 ELSE 116 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv) 117 ENDIF 105 118 ! ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 106 119 ierr = NF_DEF_DIM (nid, "interlayer", (nbp_lev+1), idim_llmp1) … … 164 177 c 165 178 c -------------------------- 179 166 180 lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon) 167 !add extra redundant point (180 degrees, since lon_reg starts at -180 168 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 181 IF (nbp_lon*nbp_lat/=1) THEN 182 ! In 3D, add extra redundant point (180 degrees, 183 ! since lon_reg starts at -180) 184 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 185 ENDIF 169 186 170 187 ierr = NF_REDEF (nid) -
trunk/LMDZ.GENERIC/libf/phystd/iniwrite_specIR.F
r1529 r1531 1 SUBROUTINE iniwrite_specIR(nid,idayref,area )1 SUBROUTINE iniwrite_specIR(nid,idayref,area,nbplon,nbplat) 2 2 3 3 use radinc_h, only: L_NSPECTI … … 36 36 integer,intent(in) :: nid ! NetCDF file ID 37 37 INTEGER*4,intent(in) :: idayref ! date (initial date for this run) 38 real,intent(in) :: area(nbp_lon+1,nbp_lat) ! mesh area (m2) 38 real,intent(in) :: area(nbplon,nbplat) ! mesh area (m2) 39 integer,intent(in) :: nbplon,nbplat ! sizes of area 39 40 40 41 c Local: … … 44 45 REAL tab_cntrl(length) ! run parameters are stored in this array 45 46 INTEGER ierr 46 REAl :: lon_reg_ext(nbp_lon+1) ! extended longitudes47 REAl,ALLOCATABLE :: lon_reg_ext(:) ! extended longitudes 47 48 48 49 integer :: nvarid,idim_index,idim_rlonu,idim_rlonv … … 53 54 54 55 c----------------------------------------------------------------------- 56 57 IF (nbp_lon*nbp_lat==1) THEN 58 ! 1D model 59 ALLOCATE(lon_reg_ext(1)) 60 ELSE 61 ! 3D model 62 ALLOCATE(lon_reg_ext(nbp_lon+1)) 63 ENDIF 55 64 56 65 DO l=1,length … … 103 112 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 104 113 ierr = NF_DEF_DIM (nid, "latitude", nbp_lat, idim_rlatu) 105 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv) 106 ierr = NF_DEF_DIM (nid, "IR Wavenumber",L_NSPECTI,idim_bandsIR) 114 IF (nbp_lon*nbp_lat==1) THEN 115 ierr = NF_DEF_DIM (nid, "longitude", 1, idim_rlonv) 116 ELSE 117 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv) 118 ENDIF 119 ierr = NF_DEF_DIM (nid, "IR_Wavenumber",L_NSPECTI,idim_bandsIR) 107 120 108 121 ierr = NF_ENDDEF(nid) … … 149 162 lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon) 150 163 !add extra redundant point (180 degrees, since lon_reg starts at -180 151 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 164 IF (nbp_lon*nbp_lat/=1) THEN 165 ! In 3D, add extra redundant point (180 degrees, 166 ! since lon_reg starts at -180) 167 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 168 ENDIF 152 169 153 170 ierr = NF_REDEF (nid) … … 175 192 ! define variable 176 193 #ifdef NC_DOUBLE 177 ierr=NF_DEF_VAR(nid,"IR 178 . idim_bandsIR,nvarid) 179 #else 180 ierr=NF_DEF_VAR(nid,"IR 194 ierr=NF_DEF_VAR(nid,"IR_Wavenumber",NF_DOUBLE,1, 195 . idim_bandsIR,nvarid) 196 #else 197 ierr=NF_DEF_VAR(nid,"IR_Wavenumber",NF_FLOAT,1, 181 198 . idim_bandsIR,nvarid) 182 199 #endif … … 199 216 ! define variable 200 217 #ifdef NC_DOUBLE 201 ierr=NF_DEF_VAR(nid,"IR 202 . idim_bandsIR,nvarid) 203 #else 204 ierr=NF_DEF_VAR(nid,"IR 218 ierr=NF_DEF_VAR(nid,"IR_Bandwidth",NF_DOUBLE,1, 219 . idim_bandsIR,nvarid) 220 #else 221 ierr=NF_DEF_VAR(nid,"IR_Bandwidth",NF_FLOAT,1, 205 222 . idim_bandsIR,nvarid) 206 223 #endif -
trunk/LMDZ.GENERIC/libf/phystd/iniwrite_specVI.F
r1529 r1531 1 SUBROUTINE iniwrite_specVI(nid,idayref,area )1 SUBROUTINE iniwrite_specVI(nid,idayref,area,nbplon,nbplat) 2 2 3 3 use radinc_h, only: L_NSPECTV … … 36 36 integer,intent(in) :: nid ! NetCDF file ID 37 37 INTEGER*4,INTENT(IN) :: idayref ! date (initial date for this run) 38 real,intent(in) :: area(nbp_lon+1,nbp_lat) ! mesh area (m2) 38 real,intent(in) :: area(nbplon,nbplat) ! mesh area (m2) 39 integer,intent(in) :: nbplon,nbplat ! sizes of area 39 40 40 41 c Local: … … 44 45 REAL tab_cntrl(length) ! run parameters are stored in this array 45 46 INTEGER ierr 46 REAl :: lon_reg_ext(nbp_lon+1) ! extended longitudes47 REAl,ALLOCATABLE :: lon_reg_ext(:) ! extended longitudes 47 48 48 49 integer :: nvarid,idim_index,idim_rlonu,idim_rlonv … … 53 54 54 55 c----------------------------------------------------------------------- 56 57 IF (nbp_lon*nbp_lat==1) THEN 58 ! 1D model 59 ALLOCATE(lon_reg_ext(1)) 60 ELSE 61 ! 3D model 62 ALLOCATE(lon_reg_ext(nbp_lon+1)) 63 ENDIF 55 64 56 65 DO l=1,length … … 103 112 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 104 113 ierr = NF_DEF_DIM (nid, "latitude", nbp_lat, idim_rlatu) 105 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv) 106 ierr = NF_DEF_DIM (nid, "VI Wavenumber",L_NSPECTV,idim_bandsVI) 114 IF (nbp_lon*nbp_lat==1) THEN 115 ierr = NF_DEF_DIM (nid, "longitude", 1, idim_rlonv) 116 ELSE 117 ierr = NF_DEF_DIM (nid, "longitude", nbp_lon+1, idim_rlonv) 118 ENDIF 119 ierr = NF_DEF_DIM (nid, "VI_Wavenumber",L_NSPECTV,idim_bandsVI) 107 120 108 121 ierr = NF_ENDDEF(nid) … … 148 161 lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon) 149 162 !add extra redundant point (180 degrees, since lon_reg starts at -180 150 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 163 IF (nbp_lon*nbp_lat/=1) THEN 164 ! In 3D, add extra redundant point (180 degrees, 165 ! since lon_reg starts at -180) 166 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 167 ENDIF 151 168 152 169 ierr = NF_REDEF (nid) … … 174 191 ! define variable 175 192 #ifdef NC_DOUBLE 176 ierr=NF_DEF_VAR(nid,"VI 177 . idim_bandsVI,nvarid) 178 #else 179 ierr=NF_DEF_VAR(nid,"VI 193 ierr=NF_DEF_VAR(nid,"VI_Wavenumber",NF_DOUBLE,1, 194 . idim_bandsVI,nvarid) 195 #else 196 ierr=NF_DEF_VAR(nid,"VI_Wavenumber",NF_FLOAT,1, 180 197 . idim_bandsVI,nvarid) 181 198 #endif … … 199 216 ! define variable 200 217 #ifdef NC_DOUBLE 201 ierr=NF_DEF_VAR(nid,"VI 202 . idim_bandsVI,nvarid) 203 #else 204 ierr=NF_DEF_VAR(nid,"VI 218 ierr=NF_DEF_VAR(nid,"VI_Bandwidth",NF_DOUBLE,1, 219 . idim_bandsVI,nvarid) 220 #else 221 ierr=NF_DEF_VAR(nid,"VI_Bandwidth",NF_FLOAT,1, 205 222 . idim_bandsVI,nvarid) 206 223 #endif -
trunk/LMDZ.GENERIC/libf/phystd/iniwritesoil.F90
r1529 r1531 1 subroutine iniwritesoil(nid,ngrid,inertia,area )1 subroutine iniwritesoil(nid,ngrid,inertia,area,nbplon,nbplat) 2 2 3 3 ! initialization routine for 'writediagoil'. Here we create/define … … 17 17 integer,intent(in) :: ngrid 18 18 integer,intent(in) :: nid ! NetCDF output file ID 19 real,intent(in) :: inertia(nbp_lon+1,nbp_lat,nsoilmx) 20 real,intent(in) :: area(nbp_lon+1,nbp_lat) ! mesh area (m2) 19 real,intent(in) :: inertia(nbplon,nbplat,nsoilmx) 20 real,intent(in) :: area(nbplon,nbp_lat) ! mesh area (m2) 21 integer,intent(in) :: nbplon,nbplat ! sizes of area 21 22 22 23 ! Local variables: … … 33 34 real,dimension(nbp_lon+1,nbp_lat,nsoilmx) :: data3 ! to store 3D data 34 35 integer :: i,j,l,ig0 35 real :: lon_reg_ext(nbp_lon+1) ! extended longitudes 36 real,allocatable :: lon_reg_ext(:) ! extended longitudes 37 38 39 if (nbp_lon*nbp_lat==1) then 40 ! 1D model 41 allocate(lon_reg_ext(1)) 42 else 43 ! 3D model 44 allocate(lon_reg_ext(nbp_lon+1)) 45 endif 36 46 37 47 ! 1. Define the dimensions … … 40 50 41 51 ! Define the dimensions 42 ierr=NF_DEF_DIM(nid,"longitude",nbp_lon+1,idim_rlonv) 52 if (nbp_lon*nbp_lat==1) then 53 ierr=NF_DEF_DIM(nid,"longitude",1,idim_rlonv) 54 else 55 ierr=NF_DEF_DIM(nid,"longitude",nbp_lon+1,idim_rlonv) 56 endif 43 57 if (ierr.ne.NF_NOERR) then 44 58 write(*,*)"iniwritesoil: Error, could not define longitude dimension" … … 82 96 83 97 lon_reg_ext(1:nbp_lon)=lon_reg(1:nbp_lon) 84 !add extra redundant point (180 degrees, since lon_reg starts at -180 85 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 98 if (nbp_lon*nbp_lat/=1) then ! in 3D only: 99 ! add extra redundant point (180 degrees, since lon_reg starts at -180 100 lon_reg_ext(nbp_lon+1)=-lon_reg_ext(1) 101 endif 86 102 87 103 ! Write longitude to file -
trunk/LMDZ.GENERIC/libf/phystd/mkstat.F90
r1529 r1531 12 12 use statto_mod, only: istime,count 13 13 use mod_phys_lmdz_para, only : is_master 14 use mod_grid_phy_lmdz, only : nbp_lon, nbp_lat, nbp_lev 14 use mod_grid_phy_lmdz, only : nbp_lon, nbp_lat, nbp_lev, klon_glo 15 15 16 16 implicit none … … 22 22 integer, dimension(5) :: dimids 23 23 character (len=50) :: name,nameout,units,title 24 real, dimension(nbp_lon+1,nbp_lat,nbp_lev) :: sum3d,square3d,mean3d,sd3d25 real, dimension(nbp_lon+1,nbp_lat) :: sum2d,square2d,mean2d,sd2d24 real,allocatable :: sum3d(:,:,:),square3d(:,:,:),mean3d(:,:,:),sd3d(:,:,:) 25 real,allocatable :: sum2d(:,:),square2d(:,:),mean2d(:,:),sd2d(:,:) 26 26 real, dimension(istime) :: time 27 27 real, dimension(nbp_lat) :: lat 28 real, dimension(nbp_lon+1) :: lon28 real,allocatable :: lon(:) 29 29 real, dimension(nbp_lev) :: alt 30 30 logical :: lcopy=.true. … … 38 38 if (is_master) then 39 39 ! only the master needs do this 40 if (klon_glo>1) then 41 allocate(lon(nbp_lon+1)) 42 allocate(sum3d(nbp_lon+1,nbp_lat,nbp_lev)) 43 allocate(square3d(nbp_lon+1,nbp_lat,nbp_lev)) 44 allocate(mean3d(nbp_lon+1,nbp_lat,nbp_lev)) 45 allocate(sd3d(nbp_lon+1,nbp_lat,nbp_lev)) 46 allocate(sum2d(nbp_lon+1,nbp_lat)) 47 allocate(square2d(nbp_lon+1,nbp_lat)) 48 allocate(mean2d(nbp_lon+1,nbp_lat)) 49 allocate(sd2d(nbp_lon+1,nbp_lat)) 50 else ! 1D model case 51 allocate(lon(1)) 52 allocate(sum3d(1,1,nbp_lev)) 53 allocate(square3d(1,1,nbp_lev)) 54 allocate(mean3d(1,1,nbp_lev)) 55 allocate(sd3d(1,1,nbp_lev)) 56 allocate(sum2d(1,1)) 57 allocate(square2d(1,1)) 58 allocate(mean2d(1,1)) 59 allocate(sd2d(1,1)) 60 endif 40 61 41 62 ierr = NF_OPEN("stats.nc",NF_WRITE,nid) … … 105 126 ! dimout(4)=timeid 106 127 107 size=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 128 if (klon_glo>1) then ! general case 129 size=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 130 else ! 1D model 131 size=(/1,1,nbp_lev,1/) 132 endif 108 133 do lt=1,istime 109 134 start=(/1,1,1,lt/) … … 135 160 ! dimout(3)=timeid 136 161 137 size=(/nbp_lon+1,nbp_lat,1,0/) 162 if (klon_glo>1) then ! general case 163 size=(/nbp_lon+1,nbp_lat,1,0/) 164 else 165 size=(/1,1,1,0/) 166 endif 138 167 do lt=1,istime 139 168 start=(/1,1,lt,0/) -
trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F
r1529 r1531 63 63 real*4 dx1(nbp_lev) ! to store a 1D (column) data set 64 64 real*4 dx0 65 real*4 dx3_1d(1,nbp_lev) ! to store a profile with 1D model 66 real*4 dx2_1d ! to store a surface value with 1D model 65 67 66 68 real*4,save :: date … … 221 223 222 224 ! Build phis() and area() 223 do i=1,nbp_lon+1 ! poles 225 IF (klon_glo>1) THEN 226 do i=1,nbp_lon+1 ! poles 224 227 phis(i,1)=phisfi_glo(1) 225 228 phis(i,nbp_lat)=phisfi_glo(klon_glo) … … 227 230 area(i,1)=areafi_glo(1)/nbp_lon 228 231 area(i,nbp_lat)=areafi_glo(klon_glo)/nbp_lon 229 enddo230 do j=2,nbp_lat-1232 enddo 233 do j=2,nbp_lat-1 231 234 ig0= 1+(j-2)*nbp_lon 232 235 do i=1,nbp_lon … … 237 240 phis(nbp_lon+1,j)=phis(1,j) 238 241 area(nbp_lon+1,j)=area(1,j) 239 enddo 242 enddo 243 ENDIF 240 244 241 245 ! write "header" of file (longitudes, latitudes, geopotential, ...) 242 call iniwrite(nid,day_ini,phis,area) 246 IF (klon_glo>1) THEN ! general 3D case 247 call iniwrite(nid,day_ini,phis,area,nbp_lon+1,nbp_lat) 248 ELSE ! 1D model 249 call iniwrite(nid,day_ini,phisfi_glo(1),areafi_glo(1),1,1) 250 ENDIF 243 251 244 252 endif ! of if (is_master) … … 255 263 endif ! if (firstnom.eq.'1234567890') 256 264 257 if ( ngrid.eq.1) then265 if (klon_glo.eq.1) then 258 266 ! in testphys1d, for the 1d version of the GCM, iphysiq and irythme 259 267 ! are undefined; so set them to 1 260 268 iphysiq=1 261 269 irythme=1 262 ! NB:263 270 endif 264 271 … … 327 334 ! Passage variable physique --> variable dynamique 328 335 ! recast (copy) variable from physics grid to dynamics grid 336 IF (klon_glo>1) THEN ! General case 329 337 DO l=1,nbp_lev 330 338 DO i=1,nbp_lon+1 … … 340 348 ENDDO 341 349 ENDDO 350 ELSE ! 1D model case 351 dx3_1d(1,1:nbp_lev)=px(1,1:nbp_lev) 352 ENDIF 342 353 #endif 343 354 ! Ecriture du champs … … 367 378 corner(4)=ntime 368 379 369 edges(1)=nbp_lon+1 380 IF (klon_glo==1) THEN 381 edges(1)=1 382 ELSE 383 edges(1)=nbp_lon+1 384 ENDIF 370 385 edges(2)=nbp_lat 371 386 edges(3)=nbp_lev … … 378 393 ! write(*,*)" edges()=",edges 379 394 ! write(*,*)" dx3()=",dx3 380 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3) 395 IF (klon_glo>1) THEN ! General case 396 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3) 397 ELSE 398 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3_1d) 399 ENDIF 381 400 !#endif 382 401 383 402 if (ierr.ne.NF_NOERR) then 384 403 write(*,*) "***** PUT_VAR problem in writediagfi" 385 write(*,*) "***** with ",nom404 write(*,*) "***** with dx3: ",nom 386 405 write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr) 387 c call abort 406 stop 388 407 endif 389 408 … … 412 431 ! Passage variable physique --> physique dynamique 413 432 ! recast (copy) variable from physics grid to dynamics grid 414 433 IF (klon_glo>1) THEN ! General case 415 434 DO i=1,nbp_lon+1 416 435 dx2(i,1)=px(1,1) … … 424 443 dx2(nbp_lon+1,j)=dx2(1,j) 425 444 ENDDO 445 ELSE ! 1D model case 446 dx2_1d=px(1,1) 447 ENDIF 426 448 #endif 427 449 … … 449 471 corner(2)=1 450 472 corner(3)=ntime 451 edges(1)=nbp_lon+1 473 IF (klon_glo==1) THEN 474 edges(1)=1 475 ELSE 476 edges(1)=nbp_lon+1 477 ENDIF 452 478 edges(2)=nbp_lat 453 479 edges(3)=1 … … 457 483 ! ierr = NF_PUT_VARA_DOUBLE (nid,varid,corner,edges,dx2) 458 484 !#else 459 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx2) 485 IF (klon_glo>1) THEN ! General case 486 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx2) 487 ELSE 488 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx2_1d) 489 ENDIF 460 490 !#endif 461 491 462 492 if (ierr.ne.NF_NOERR) then 463 493 write(*,*) "***** PUT_VAR matter in writediagfi" 464 write(*,*) "***** with ",nom494 write(*,*) "***** with dx2: ",nom 465 495 write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr) 466 c call abort 496 stop 467 497 endif 468 498 … … 512 542 if (ierr.ne.NF_NOERR) then 513 543 write(*,*) "***** PUT_VAR problem in writediagfi" 514 write(*,*) "***** with ",nom544 write(*,*) "***** with dx1: ",nom 515 545 write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr) 516 c call abort 546 stop 517 547 endif 518 548 … … 550 580 if (ierr.ne.NF_NOERR) then 551 581 write(*,*) "***** PUT_VAR matter in writediagfi" 552 write(*,*) "***** with ",nom582 write(*,*) "***** with dx0: ",nom 553 583 write(*,*) 'ierr=', ierr,": ",NF_STRERROR(ierr) 554 c call abort 584 stop 555 585 endif 556 586 -
trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90
r1529 r1531 36 36 real*4,dimension(nbp_lon+1,nbp_lat) :: data2 ! to store 2D data 37 37 real*4 :: data0 ! to store 0D data 38 real*4 :: data3_1d(1,nsoilmx) ! to store a profile in 1D model 39 real*4 :: data2_1d ! to store surface value with 1D model 38 40 integer :: i,j,l ! for loops 39 41 integer :: ig0 … … 108 110 109 111 ! build inertia() and area() 110 do i=1,nbp_lon+1 ! poles 112 if (klon_glo>1) then 113 do i=1,nbp_lon+1 ! poles 111 114 inertia(i,1,1:nsoilmx)=inertiafi_glo(1,1:nsoilmx) 112 115 inertia(i,nbp_lat,1:nsoilmx)=inertiafi_glo(klon_glo,1:nsoilmx) … … 114 117 area(i,1)=areafi_glo(1)/nbp_lon 115 118 area(i,nbp_lat)=areafi_glo(klon_glo)/nbp_lon 116 enddo117 do j=2,nbp_lat-1119 enddo 120 do j=2,nbp_lat-1 118 121 ig0= 1+(j-2)*nbp_lon 119 122 do i=1,nbp_lon … … 124 127 inertia(nbp_lon+1,j,1:nsoilmx)=inertia(1,j,1:nsoilmx) 125 128 area(nbp_lon+1,j)=area(1,j) 126 enddo 129 enddo 130 endif 127 131 128 132 ! write "header" of file (longitudes, latitudes, geopotential, ...) 129 call iniwritesoil(nid,ngrid,inertia,area) 133 if (klon_glo>1) then ! general 3D case 134 call iniwritesoil(nid,ngrid,inertia,area,nbp_lon+1,nbp_lat) 135 else ! 1D model 136 call iniwritesoil(nid,ngrid,inertiafi_glo(1,:),areafi_glo(1),1,1) 137 endif 130 138 131 139 endif ! of if (is_master) … … 189 197 !$OMP BARRIER 190 198 #else 191 do l=1,nsoilmx 199 if (klon_glo>1) then ! General case 200 do l=1,nsoilmx 192 201 ! handle the poles 193 202 do i=1,nbp_lon+1 … … 203 212 data3(nbp_lon+1,j,l)=data3(1,j,l) ! extra (modulo) longitude 204 213 enddo 205 enddo 214 enddo 215 else ! 1D model case 216 data3_1d(1,1:nsoilmx)=px(1,1:nsoilmx) 217 endif 206 218 #endif 207 219 … … 230 242 corners(4)=ntime 231 243 232 edges(1)=nbp_lon+1 244 if (klon_glo==1) then 245 edges(1)=1 246 else 247 edges(1)=nbp_lon+1 248 endif 233 249 edges(2)=nbp_lat 234 250 edges(3)=nsoilmx … … 239 255 ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,corners,edges,data3) 240 256 !#else 241 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data3) 257 if (klon_glo>1) then 258 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data3) 259 else 260 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data3_1d) 261 endif 242 262 !#endif 243 263 if (ierr.ne.NF_NOERR) then … … 264 284 !$OMP BARRIER 265 285 #else 266 ! handle the poles 267 do i=1,nbp_lon+1 268 data2(i,1)=px(1,1) 269 data2(i,nbp_lat)=px(ngrid,1) 270 enddo 271 ! rest of the grid 272 do j=2,nbp_lat-1 273 ig0=1+(j-2)*nbp_lon 274 do i=1,nbp_lon 275 data2(i,j)=px(ig0+i,1) 276 enddo 277 data2(nbp_lon+1,j)=data2(1,j) ! extra (modulo) longitude 278 enddo 286 if (klon_glo>1) then ! general case 287 ! handle the poles 288 do i=1,nbp_lon+1 289 data2(i,1)=px(1,1) 290 data2(i,nbp_lat)=px(ngrid,1) 291 enddo 292 ! rest of the grid 293 do j=2,nbp_lat-1 294 ig0=1+(j-2)*nbp_lon 295 do i=1,nbp_lon 296 data2(i,j)=px(ig0+i,1) 297 enddo 298 data2(nbp_lon+1,j)=data2(1,j) ! extra (modulo) longitude 299 enddo 300 else ! 1D model case 301 data2_1d=px(1,1) 302 endif 279 303 #endif 280 304 … … 301 325 corners(3)=ntime 302 326 303 edges(1)=nbp_lon+1 327 if (klon_glo==1) then 328 edges(1)=1 329 else 330 edges(1)=nbp_lon+1 331 endif 304 332 edges(2)=nbp_lat 305 333 edges(3)=1 … … 309 337 ! ierr=NF_PUT_VARA_DOUBLE(nid,varid,corners,edges,data2) 310 338 !#else 311 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data2) 339 if (klon_glo>1) then ! General case 340 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data2) 341 else 342 ierr=NF_PUT_VARA_REAL(nid,varid,corners,edges,data2_1d) 343 endif 312 344 !#endif 313 345 if (ierr.ne.NF_NOERR) then -
trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F
r1529 r1531 87 87 real area((nbp_lon+1),nbp_lat) 88 88 ! added by RDW for OLR output 89 real dx3(nbp_lon+1,nbp_lat,L_NSPECTI) ! to store the data set 89 real dx3(nbp_lon+1,nbp_lat,L_NSPECTI) ! to store the data set 90 real dx3_1d(1,L_NSPECTI) ! to store the data with 1D model 90 91 91 92 #ifdef CPP_PARA … … 152 153 153 154 ! Build area() 154 do i=1,nbp_lon+1 ! poles 155 IF (klon_glo>1) THEN 156 do i=1,nbp_lon+1 ! poles 155 157 ! divide at the poles by nbp_lon 156 158 area(i,1)=areafi_glo(1)/nbp_lon 157 159 area(i,nbp_lat)=areafi_glo(klon_glo)/nbp_lon 158 enddo159 do j=2,nbp_lat-1160 enddo 161 do j=2,nbp_lat-1 160 162 ig0= 1+(j-2)*nbp_lon 161 163 do i=1,nbp_lon … … 164 166 ! handle redundant point in longitude 165 167 area(nbp_lon+1,j)=area(1,j) 166 enddo 168 enddo 169 ENDIF 167 170 168 171 ! write "header" of file (longitudes, latitudes, area, ...) 169 call iniwrite_specIR(nid,day_ini,area) 172 IF (klon_glo>1) THEN ! general 3D case 173 call iniwrite_specIR(nid,day_ini,area,nbp_lon+1,nbp_lat) 174 ELSE 175 call iniwrite_specIR(nid,day_ini,areafi_glo(1),1,1) 176 ENDIF 170 177 endif ! of if (is_master) 171 178 … … 245 252 !$OMP BARRIER 246 253 #else 254 IF (klon_glo>1) THEN ! General case 247 255 DO l=1,L_NSPECTI 248 256 DO i=1,nbp_lon+1 … … 258 266 ENDDO 259 267 ENDDO 268 ELSE ! 1D model case 269 dx3_1d(1,1:L_NSPECTI)=px(1,1:L_NSPECTI) 270 ENDIF 260 271 #endif 261 272 … … 269 280 ierr= NF_INQ_DIMID(nid,"longitude",id(1)) 270 281 ierr= NF_INQ_DIMID(nid,"latitude",id(2)) 271 ierr= NF_INQ_DIMID(nid,"IR 282 ierr= NF_INQ_DIMID(nid,"IR_Wavenumber",id(3)) 272 283 ierr= NF_INQ_DIMID(nid,"Time",id(4)) 273 284 … … 285 296 corner(4)=ntime 286 297 287 edges(1)=nbp_lon+1 298 IF (klon_glo==1) THEN 299 edges(1)=1 300 ELSE 301 edges(1)=nbp_lon+1 302 ENDIF 288 303 edges(2)=nbp_lat 289 304 edges(3)=L_NSPECTI 290 305 edges(4)=1 291 306 #ifdef NC_DOUBLE 292 ierr= NF_PUT_VARA_DOUBLE(nid,varid,corner,edges,dx3) 293 #else 294 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3) 307 IF (klon_glo>1) THEN ! General case 308 ierr= NF_PUT_VARA_DOUBLE(nid,varid,corner,edges,dx3) 309 ELSE 310 ierr= NF_PUT_VARA_DOUBLE(nid,varid,corner,edges,dx3_1d) 311 ENDIF 312 #else 313 IF (klon_glo>1) THEN ! General case 314 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3) 315 ELSE 316 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3_1d) 317 ENDIF 295 318 #endif 296 319 -
trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F
r1529 r1531 87 87 real area((nbp_lon+1),nbp_lat) 88 88 ! added by RDW for OSR output 89 real dx3(nbp_lon+1,nbp_lat,L_NSPECTV) ! to store the data set 89 real dx3(nbp_lon+1,nbp_lat,L_NSPECTV) ! to store the data set 90 real dx3_1d(1,L_NSPECTV) ! to store the data with 1D model 90 91 91 92 #ifdef CPP_PARA … … 151 152 152 153 ! Build area() 153 do i=1,nbp_lon+1 ! poles 154 IF (klon_glo>1) THEN 155 do i=1,nbp_lon+1 ! poles 154 156 ! divide at the poles by nbp_lon 155 157 area(i,1)=areafi_glo(1)/nbp_lon 156 158 area(i,nbp_lat)=areafi_glo(klon_glo)/nbp_lon 157 enddo158 do j=2,nbp_lat-1159 enddo 160 do j=2,nbp_lat-1 159 161 ig0= 1+(j-2)*nbp_lon 160 162 do i=1,nbp_lon … … 163 165 ! handle redundant point in longitude 164 166 area(nbp_lon+1,j)=area(1,j) 165 enddo 167 enddo 168 ENDIF 166 169 167 170 ! write "header" of file (longitudes, latitudes, geopotential, ...) 168 call iniwrite_specVI(nid,day_ini,area) 171 IF (klon_glo>1) THEN ! general 3D case 172 call iniwrite_specVI(nid,day_ini,area,nbp_lon+1,nbp_lat) 173 ELSE 174 call iniwrite_specVI(nid,day_ini,areafi_glo(1),1,1) 175 ENDIF 169 176 endif ! of if (is_master) 170 177 … … 244 251 !$OMP BARRIER 245 252 #else 253 IF (klon_glo>1) THEN ! General case 246 254 DO l=1,L_NSPECTV 247 255 DO i=1,nbp_lon+1 … … 257 265 ENDDO 258 266 ENDDO 267 ELSE ! 1D model case 268 dx3_1d(1,1:L_NSPECTV)=px(1,1:L_NSPECTV) 269 ENDIF 259 270 #endif 260 271 … … 268 279 ierr= NF_INQ_DIMID(nid,"longitude",id(1)) 269 280 ierr= NF_INQ_DIMID(nid,"latitude",id(2)) 270 ierr= NF_INQ_DIMID(nid,"VI 281 ierr= NF_INQ_DIMID(nid,"VI_Wavenumber",id(3)) 271 282 ierr= NF_INQ_DIMID(nid,"Time",id(4)) 272 283 … … 284 295 corner(4)=ntime 285 296 286 edges(1)=nbp_lon+1 297 IF (klon_glo==1) THEN 298 edges(1)=1 299 ELSE 300 edges(1)=nbp_lon+1 301 ENDIF 287 302 edges(2)=nbp_lat 288 303 edges(3)=L_NSPECTV 289 304 edges(4)=1 290 305 #ifdef NC_DOUBLE 291 ierr= NF_PUT_VARA_DOUBLE(nid,varid,corner,edges,dx3) 292 #else 293 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3) 306 IF (klon_glo>1) THEN ! General case 307 ierr= NF_PUT_VARA_DOUBLE(nid,varid,corner,edges,dx3) 308 ELSE 309 ierr= NF_PUT_VARA_DOUBLE(nid,varid,corner,edges,dx3_1d) 310 ENDIF 311 #else 312 IF (klon_glo>1) THEN ! General case 313 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3) 314 ELSE 315 ierr= NF_PUT_VARA_REAL(nid,varid,corner,edges,dx3_1d) 316 ENDIF 294 317 #endif 295 318 -
trunk/LMDZ.GENERIC/libf/phystd/wstats.F90
r1529 r1531 13 13 integer,intent(in) :: dim 14 14 real,intent(in) :: px(ngrid,nbp_lev) 15 real, dimension(nbp_lon+1,nbp_lat,nbp_lev) :: mean3d,sd3d,dx316 real, dimension(nbp_lon+1,nbp_lat) :: mean2d,sd2d,dx215 real,allocatable,save :: mean3d(:,:,:),sd3d(:,:,:),dx3(:,:,:) 16 real,allocatable,save :: mean2d(:,:),sd2d(:,:),dx2(:,:) 17 17 character (len=50) :: namebis 18 18 character (len=50), save :: firstvar … … 49 49 firstvar=trim((nom)) 50 50 call inistats(ierr) 51 if (klon_glo>1) then ! general case, 3D GCM 52 allocate(mean3d(nbp_lon+1,nbp_lat,nbp_lev)) 53 allocate(sd3d(nbp_lon+1,nbp_lat,nbp_lev)) 54 allocate(dx3(nbp_lon+1,nbp_lat,nbp_lev)) 55 allocate(mean2d(nbp_lon+1,nbp_lat)) 56 allocate(sd2d(nbp_lon+1,nbp_lat)) 57 allocate(dx2(nbp_lon+1,nbp_lat)) 58 else ! 1D model 59 allocate(mean3d(1,1,nbp_lev)) 60 allocate(sd3d(1,1,nbp_lev)) 61 allocate(dx3(1,1,nbp_lev)) 62 allocate(mean2d(1,1)) 63 allocate(sd2d(1,1)) 64 allocate(dx2(1,1)) 65 endif 51 66 endif 52 67 … … 194 209 if (dim.eq.3) then 195 210 start=(/1,1,1,indx/) 196 sizes=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 211 if (klon_glo>1) then !general case 212 sizes=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 213 else 214 sizes=(/1,1,nbp_lev,1/) 215 endif 197 216 mean3d(:,:,:)=0 198 217 sd3d(:,:,:)=0 199 218 else if (dim.eq.2) then 200 219 start=(/1,1,indx,0/) 201 sizes=(/nbp_lon+1,nbp_lev,1,0/) 220 if (klon_glo>1) then !general case 221 sizes=(/nbp_lon+1,nbp_lev,1,0/) 222 else 223 sizes=(/1,1,1,0/) 224 endif 202 225 mean2d(:,:)=0 203 226 sd2d(:,:)=0 … … 207 230 if (dim.eq.3) then 208 231 start=(/1,1,1,indx/) 209 sizes=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 232 if (klon_glo>1) then !general case 233 sizes=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 234 else ! 1D model case 235 sizes=(/1,1,nbp_lev,1/) 236 endif 210 237 #ifdef NC_DOUBLE 211 238 ierr = NF_GET_VARA_DOUBLE(nid,meanid,start,sizes,mean3d) … … 216 243 #endif 217 244 if (ierr.ne.NF_NOERR) then 245 write (*,*) "wstats error reading :",trim(nom) 218 246 write (*,*) NF_STRERROR(ierr) 219 247 stop "" … … 222 250 else if (dim.eq.2) then 223 251 start=(/1,1,indx,0/) 224 sizes=(/nbp_lon+1,nbp_lat,1,0/) 252 if (klon_glo>1) then ! general case 253 sizes=(/nbp_lon+1,nbp_lat,1,0/) 254 else 255 sizes=(/1,1,1,0/) 256 endif 225 257 #ifdef NC_DOUBLE 226 258 ierr = NF_GET_VARA_DOUBLE(nid,meanid,start,sizes,mean2d) … … 231 263 #endif 232 264 if (ierr.ne.NF_NOERR) then 265 write (*,*) "wstats error reading :",trim(nom) 233 266 write (*,*) NF_STRERROR(ierr) 234 267 stop "" … … 242 275 if (dim.eq.3) then 243 276 dx3(1:nbp_lon,:,:)=px3_glo(:,:,:) 244 dx3(nbp_lon+1,:,:)=dx3(1,:,:) 277 IF (klon_glo>1) THEN ! in 3D, add redundant longitude point 278 dx3(nbp_lon+1,:,:)=dx3(1,:,:) 279 ENDIF 245 280 else ! dim.eq.2 246 281 dx2(1:nbp_lon,:)=px2_glo(:,:) 247 dx2(nbp_lon+1,:)=dx2(1,:) 282 IF (klon_glo>1) THEN ! in 3D, add redundant longitude point 283 dx2(nbp_lon+1,:)=dx2(1,:) 284 ENDIF 248 285 endif 249 286 … … 263 300 ierr = NF_PUT_VARA_REAL(nid,sdid,start,sizes,sd3d) 264 301 #endif 302 if (ierr.ne.NF_NOERR) then 303 write (*,*) "wstats error writing :",trim(nom) 304 write (*,*) NF_STRERROR(ierr) 305 stop "" 306 endif 265 307 266 308 else if (dim.eq.2) then … … 276 318 ierr = NF_PUT_VARA_REAL(nid,sdid,start,sizes,sd2d) 277 319 #endif 320 if (ierr.ne.NF_NOERR) then 321 write (*,*) "wstats error writing :",trim(nom) 322 write(*,*) "start:",start 323 write(*,*) "sizes:",sizes 324 write(*,*) "mean2d:",mean2d 325 write(*,*) "sd2d:",sd2d 326 write (*,*) NF_STRERROR(ierr) 327 stop "" 328 endif 278 329 279 330 endif ! of if (dim.eq.3) elseif (dim.eq.2) … … 286 337 !====================================================== 287 338 subroutine inivar(nid,varid,ngrid,dim,indx,px,ierr) 288 use mod_grid_phy_lmdz, only : nbp_lon, nbp_lat, nbp_lev 339 use mod_grid_phy_lmdz, only : nbp_lon, nbp_lat, nbp_lev, klon_glo 289 340 290 341 implicit none … … 300 351 real, dimension(nbp_lon+1,nbp_lat,nbp_lev) :: dx3 301 352 real, dimension(nbp_lon+1,nbp_lat) :: dx2 353 real :: dx3_1d(nbp_lev) ! for 1D outputs 354 real :: dx2_1d ! for 1D outputs 302 355 303 356 if (dim.eq.3) then 304 357 305 358 start=(/1,1,1,indx/) 306 sizes=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 359 if (klon_glo>1) then ! general 3D case 360 sizes=(/nbp_lon+1,nbp_lat,nbp_lev,1/) 361 else 362 sizes=(/1,1,nbp_lev,1/) 363 endif 307 364 308 365 ! Passage variable physique --> variable dynamique 309 366 310 DO l=1,nbp_lev 367 if (klon_glo>1) then ! general case 368 DO l=1,nbp_lev 311 369 DO i=1,nbp_lon+1 312 370 dx3(i,1,l)=px(1,l) … … 320 378 dx3(nbp_lon+1,j,l)=dx3(1,j,l) 321 379 ENDDO 322 ENDDO 323 324 #ifdef NC_DOUBLE 325 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,sizes,dx3) 326 #else 327 ierr = NF_PUT_VARA_REAL(nid,varid,start,sizes,dx3) 328 #endif 380 ENDDO 381 else ! 1D model case 382 dx3_1d(1:nbp_lev)=px(1,1:nbp_lev) 383 endif 384 385 #ifdef NC_DOUBLE 386 if (klon_glo>1) then 387 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,sizes,dx3) 388 else 389 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,sizes,dx3_1d) 390 endif 391 #else 392 if (klon_glo>1) then 393 ierr = NF_PUT_VARA_REAL(nid,varid,start,sizes,dx3) 394 else 395 ierr = NF_PUT_VARA_REAL(nid,varid,start,sizes,dx3_1d) 396 endif 397 #endif 398 if (ierr.ne.NF_NOERR) then 399 write (*,*) "inivar error writing variable" 400 write (*,*) NF_STRERROR(ierr) 401 stop "" 402 endif 329 403 330 404 else if (dim.eq.2) then 331 405 332 406 start=(/1,1,indx,0/) 333 sizes=(/nbp_lon+1,nbp_lat,1,0/) 407 if (klon_glo>1) then ! general 3D case 408 sizes=(/nbp_lon+1,nbp_lat,1,0/) 409 else 410 sizes=(/1,1,1,0/) 411 endif 334 412 335 413 ! Passage variable physique --> physique dynamique 336 414 415 if (klon_glo>1) then ! general case 337 416 DO i=1,nbp_lon+1 338 417 dx2(i,1)=px(1,1) … … 346 425 dx2(nbp_lon+1,j)=dx2(1,j) 347 426 ENDDO 348 349 #ifdef NC_DOUBLE 350 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,sizes,dx2) 351 #else 352 ierr = NF_PUT_VARA_REAL(nid,varid,start,sizes,dx2) 353 #endif 427 else ! 1D model case 428 dx2_1d=px(1,1) 429 endif 430 431 #ifdef NC_DOUBLE 432 if (klon_glo>1) then 433 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,sizes,dx2) 434 else 435 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,sizes,dx2_1d) 436 endif 437 #else 438 if (klon_glo>1) then 439 ierr = NF_PUT_VARA_REAL(nid,varid,start,sizes,dx2) 440 else 441 ierr = NF_PUT_VARA_REAL(nid,varid,start,sizes,dx2_1d) 442 endif 443 #endif 444 if (ierr.ne.NF_NOERR) then 445 write (*,*) "inivar error writing variable" 446 write (*,*) NF_STRERROR(ierr) 447 stop "" 448 endif 354 449 355 450 endif
Note: See TracChangeset
for help on using the changeset viewer.