Changeset 1925
- Timestamp:
- Jan 8, 2014, 10:38:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/cosp/phys_cosp.F90
r1907 r1925 7 7 ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, & 8 8 ecrit_mth,ecrit_day,ecrit_hf, & 9 Nptslmdz,Nlevlmdz,lon,lat, presnivs,overlaplmdz, &9 Nptslmdz,Nlevlmdz,lon,lat, presnivs,overlaplmdz,sunlit, & 10 10 ref_liq,ref_ice,fracTerLic,u_wind,v_wind,phis,phi,ph,p,skt,t, & 11 11 sh,rh,tca,cca,mr_lsliq,mr_lsice,fl_lsrainI,fl_lssnowI, & … … 22 22 ! lon,lat, !Longitudes et latitudes de la grille LMDZ 23 23 ! ref_liq,ref_ice, !Rayons effectifs des particules liq et ice (en microm) 24 ! fracTerLic, 24 ! fracTerLic, !Fraction terre a convertir en masque 25 25 ! u_wind,v_wind, !Vents a 10m ??? 26 26 ! phi, !Geopotentiel 27 ! phis, 27 ! phis, !Geopotentiel sol 28 28 ! ph, !pression pour chaque inter-couche 29 29 ! p, !Pression aux milieux des couches … … 76 76 use ioipsl 77 77 use iophy 78 use cosp_output_mod 79 use cosp_output_write_mod 78 80 79 81 IMPLICIT NONE … … 86 88 integer, save :: isccp_topheight,isccp_topheight_direction,overlap 87 89 integer,save :: Ncolumns ! Number of subcolumns in SCOPS 88 ! integer,parameter :: Ncollmdz=2089 integer,parameter :: Ncolmax=10090 90 integer, save :: Npoints ! Number of gridpoints 91 91 !$OMP THREADPRIVATE(Npoints) … … 119 119 120 120 ! Declaration necessaires pour les sorties IOIPSL 121 integer :: ii ,idayref122 real :: zjulian,zstoday,zstomth,zstohf,zout,ecrit_day,ecrit_hf,ecrit_mth121 integer :: ii 122 real :: ecrit_day,ecrit_hf,ecrit_mth 123 123 logical :: ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP 124 integer :: nhori,nvert,nvertp,nvertisccp,nvertmcosp,nvertcol 125 integer, save :: nid_day_cosp,nid_mth_cosp,nid_hf_cosp 126 !$OMP THREADPRIVATE(nid_day_cosp,nid_mth_cosp,nid_hf_cosp) 124 127 125 logical, save :: debut_cosp=.true. 128 126 !$OMP THREADPRIVATE(debut_cosp) 129 integer :: itau_wcosp130 character(len=2) :: str2131 real,dimension(Ncolmax) :: column_ax132 character(len=10),save,dimension(Ncolmax) :: chcol133 134 integer, save :: Nlevout135 !$OMP THREADPRIVATE(Nlevout)136 127 137 128 include "dimensions.h" 138 include "temps.h"139 129 140 130 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Input variables from LMDZ-GCM … … 144 134 zlev,zlev_half,mr_ozone,radliq,radice,dtau_s,dem_s,ref_liq,ref_ice 145 135 real,dimension(Nptslmdz,Nlevlmdz) :: fl_lsrainI,fl_lssnowI,fl_ccrainI,fl_ccsnowI 146 real,dimension(Nptslmdz) :: lon,lat,skt,fracTerLic,u_wind,v_wind,phis 136 real,dimension(Nptslmdz) :: lon,lat,skt,fracTerLic,u_wind,v_wind,phis,sunlit 147 137 real,dimension(Nlevlmdz) :: presnivs 148 138 integer :: itap,k,ip 149 139 real :: dtime,freq_cosp 150 logical, parameter :: lCOSP=.FALSE. 151 140 152 141 ! 153 142 namelist/COSP_INPUT/cmor_nl,overlap,isccp_topheight,isccp_topheight_direction, & … … 173 162 CALL read_cosp_input 174 163 175 do ii=1,Ncolumns176 write(str2,'(i2.2)')ii177 chcol(ii)="c"//str2178 column_ax(ii) = real(ii)179 enddo180 181 164 ! Clefs Outputs 182 165 call read_cosp_output_nl(cosp_output_nl,cfg) … … 187 170 print*,'Fin lecture Namelists, debut_cosp =',debut_cosp 188 171 189 print*,' Cles sorties cosp :'172 print*,' Cles des differents simulateurs cosp :' 190 173 print*,' Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lrttov_sim', & 191 174 cfg%Lradar_sim,cfg%Llidar_sim,cfg%Lisccp_sim,cfg%Lmisr_sim,cfg%Lrttov_sim … … 193 176 endif ! debut_cosp 194 177 195 print*,'Debut phys_cosp itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf ', & 196 itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf 197 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 198 ! Allocate local arrays 199 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 200 ! call system_clock(t0,count_rate,count_max) !!! Only for testing purposes 201 202 178 ! print*,'Debut phys_cosp itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf ', & 179 ! itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf 203 180 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 204 181 ! Allocate memory for gridbox type … … 237 214 gbx%q = rh*100. 238 215 gbx%sh = sh 239 gbx%cca = cca !convective_cloud_amount (1) 216 ! On ne veut pas que cosp distingue les nuages stratiformes et convectifs 217 ! on passe les contenus totaux (conv+strat) 218 gbx%cca = 0. !convective_cloud_amount (1) 240 219 gbx%tca = tca ! total_cloud_amount (1) 241 220 gbx%psfc = ph(:,1) !pression de surface … … 253 232 gbx%u_wind = u_wind !eastward_wind (m s-1) 254 233 gbx%v_wind = v_wind !northward_wind 255 ! Attention 256 gbx%sunlit = 1 234 235 ! sunlit calcule a partir de la fraction d ensoleillement par jour 236 do ip = 1, Npoints 237 if (sunlit(ip).le.0.) then 238 gbx%sunlit(ip)=0. 239 else 240 gbx%sunlit(ip)=1. 241 endif 242 enddo 257 243 258 244 ! A voir l equivalent LMDZ … … 296 282 call construct_cosp_vgrid(gbx,Nlr,use_vgrid,csat_vgrid,vgrid) 297 283 298 if (debut_cosp) then299 ! Creer le fichier de sorie, definir les variable de sortie300 ! Axe verticale (Pa ou Km)301 Nlevout = vgrid%Nlvgrid302 303 do ii=1,Ncolumns304 column_ax(ii) = real(ii)305 enddo306 307 if (ok_mensuelCOSP) then308 include "ini_histmthCOSP.h"309 endif310 if (ok_journeCOSP) then311 include "ini_histdayCOSP.h"312 endif313 if (ok_hfCOSP) then314 include "ini_histhfCOSP.h"315 endif316 317 debut_cosp=.false.318 endif ! debut_cosp319 320 284 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 321 285 ! Allocate memory for other types … … 329 293 call construct_cosp_isccp(cfg,Npoints,Ncolumns,Nlevels,isccp) 330 294 call construct_cosp_misr(cfg,Npoints,misr) 295 296 !+++++++++++++ Open output files and define output files axis !+++++++++++++ 297 if (debut_cosp) then 298 299 print *, ' Open outpts files and define axis' 300 call cosp_output_open(Nlevlmdz, Ncolumns, presnivs, dtime, freq_cosp, & 301 ok_mensuelCOSP, ok_journeCOSP, ok_hfCOSP, & 302 ecrit_mth, ecrit_day, ecrit_hf, use_vgrid, vgrid) 303 304 debut_cosp=.false. 305 endif ! debut_cosp 331 306 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 332 307 ! Call simulator … … 335 310 call cosp(overlap,Ncolumns,cfg,vgrid,gbx,sgx,sgradar,sglidar,isccp,misr,stradar,stlidar) 336 311 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 337 ! Write outputs to CMOR-compliant NetCDF 338 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 339 340 ! A traiter le cas ou l on a des valeurs indefinies 341 ! Attention teste 342 343 ! if(1.eq.0)then 344 345 346 do k = 1,Nlevout 347 do ip = 1,Npoints 348 if(stlidar%lidarcld(ip,k).eq.R_UNDEF)then 349 stlidar%lidarcld(ip,k)=0. 350 endif 351 enddo 352 353 354 do ii= 1,SR_BINS 355 do ip = 1,Npoints 356 if(stlidar%cfad_sr(ip,ii,k).eq.R_UNDEF)then 357 stlidar%cfad_sr(ip,ii,k)=0. 358 endif 359 enddo 360 enddo 361 enddo 362 363 do ip = 1,Npoints 364 do k = 1,Nlevlmdz 365 if(sglidar%beta_mol(ip,k).eq.R_UNDEF)then 366 sglidar%beta_mol(ip,k)=0. 367 endif 368 369 do ii= 1,Ncolumns 370 if(sglidar%beta_tot(ip,ii,k).eq.R_UNDEF)then 371 sglidar%beta_tot(ip,ii,k)=0. 372 endif 373 enddo 374 375 enddo !k = 1,Nlevlmdz 376 enddo !ip = 1,Npoints 377 378 do k = 1,LIDAR_NCAT 379 do ip = 1,Npoints 380 if(stlidar%cldlayer(ip,k).eq.R_UNDEF)then 381 stlidar%cldlayer(ip,k)=0. 382 endif 383 enddo 384 enddo 385 386 ! endif 387 388 do ip = 1,Npoints 389 if(isccp%totalcldarea(ip).eq.-1.E+30)then 390 isccp%totalcldarea(ip)=0. 391 endif 392 if(isccp%meanptop(ip).eq.-1.E+30)then 393 isccp%meanptop(ip)=0. 394 endif 395 if(isccp%meantaucld(ip).eq.-1.E+30)then 396 isccp%meantaucld(ip)=0. 397 endif 398 if(isccp%meanalbedocld(ip).eq.-1.E+30)then 399 isccp%meanalbedocld(ip)=0. 400 endif 401 if(isccp%meantb(ip).eq.-1.E+30)then 402 isccp%meantb(ip)=0. 403 endif 404 if(isccp%meantbclr(ip).eq.-1.E+30)then 405 isccp%meantbclr(ip)=0. 406 endif 407 408 do k=1,7 409 do ii=1,7 410 if(isccp%fq_isccp(ip,ii,k).eq.-1.E+30)then 411 isccp%fq_isccp(ip,ii,k)=0. 412 endif 413 enddo 414 enddo 415 416 do ii=1,Ncolumns 417 if(isccp%boxtau(ip,ii).eq.-1.E+30)then 418 isccp%boxtau(ip,ii)=0. 419 endif 420 enddo 421 422 do ii=1,Ncolumns 423 if(isccp%boxptop(ip,ii).eq.-1.E+30)then 424 isccp%boxptop(ip,ii)=0. 425 endif 426 enddo 427 enddo 428 429 if (ok_mensuelCOSP) then 430 include "write_histmthCOSP.h" 431 endif 432 if (ok_journeCOSP) then 433 include "write_histdayCOSP.h" 434 endif 435 if (ok_hfCOSP ) then 436 include "write_histhfCOSP.h" 437 endif 312 313 !!!!!!!!!!!!!!!!!! Ecreture des sorties Cosp !!!!!!!!!!!!!!r!!!!!!:!!!!! 314 print *, 'Calling write output' 315 call cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, cfg, gbx, sglidar, stlidar, isccp) 438 316 439 317 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Note: See TracChangeset
for help on using the changeset viewer.