Changeset 72
- Timestamp:
- Feb 19, 2011, 5:36:31 PM (14 years ago)
- Location:
- trunk/mesoscale
- Files:
-
- 4 added
- 11 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/mesoscale/LMD_MM_MARS/SRC/PREP_MARS/readmeteo.F90
r69 r72 21 21 ! 12/2007 : include co2ice and emissivity ! 22 22 ! 02/2008 : include water vapor and ice ! 23 ! 01/2010 : possible use of diagsoil for new physics ! 24 ! 02/2011 : add dust tracers, correct surface ! 23 25 ! ! 24 26 ! spiga@lmd.jussieu.fr ! … … 71 73 72 74 !! Intermediate data arrays 73 integer :: k,l 74 real, dimension(:), allocatable :: lat,lon,time,alt,aps,bps,levels 75 integer :: k,l,m,n,p 76 real, dimension(:), allocatable :: lat,lon,time,alt,aps,bps,levels,dsoilvert 75 77 real, dimension(:,:), allocatable :: vide,ones,ghtsfile 76 78 real, dimension(:,:), allocatable :: interm … … 81 83 real, dimension(:,:,:,:), allocatable :: tfile,ufile,vfile,rfile,hfile 82 84 real, dimension(:,:,:,:), allocatable :: eta_gcm 83 real, dimension(:,:,:,:), allocatable :: tfileorig,ufileorig,vfileorig84 real, dimension(:,:,:,:), allocatable :: tsoilfile 85 !real, dimension(:,:,:,:), allocatable :: tfileorig,ufileorig,vfileorig 86 real, dimension(:,:,:,:), allocatable :: tsoilfile, dsoilfile, isoilfile 85 87 real, dimension(:,:,:,:), allocatable :: waterfile, watericefile 86 real, dimension(:,:,:), allocatable :: swaterfile, swatericefile 88 real, dimension(:,:,:), allocatable :: swatericefile!, swaterfile 89 real, dimension(:,:,:,:), allocatable :: dustfile,dustnfile 87 90 88 91 !! Reading the parameter file … … 202 205 allocate(tfile(lonlen,latlen,altlen,timelen)) 203 206 allocate(tsoilfile(lonlen,latlen,altlen,timelen)) 204 allocate(tfileorig(lonlen,latlen,altlen,timelen)) 207 allocate(dsoilfile(lonlen,latlen,altlen,timelen)) 208 allocate(isoilfile(lonlen,latlen,altlen,timelen)) 209 allocate(dsoilvert(altlen)) 210 !allocate(tfileorig(lonlen,latlen,altlen,timelen)) 205 211 allocate(ufile(lonlen,latlen,altlen,timelen)) 206 allocate(ufileorig(lonlen,latlen,altlen,timelen))212 !allocate(ufileorig(lonlen,latlen,altlen,timelen)) 207 213 allocate(vfile(lonlen,latlen,altlen,timelen)) 208 allocate(vfileorig(lonlen,latlen,altlen,timelen))214 !allocate(vfileorig(lonlen,latlen,altlen,timelen)) 209 215 allocate(rfile(lonlen,latlen,altlen,timelen)) 210 216 allocate(hfile(lonlen,latlen,altlen,timelen)) 211 217 allocate(waterfile(lonlen,latlen,altlen,timelen)) 212 218 allocate(watericefile(lonlen,latlen,altlen,timelen)) 213 allocate(swaterfile(lonlen,latlen,timelen))219 !allocate(swaterfile(lonlen,latlen,timelen)) 214 220 allocate(swatericefile(lonlen,latlen,timelen)) 221 allocate(dustfile(lonlen,latlen,altlen,timelen)) 222 allocate(dustnfile(lonlen,latlen,altlen,timelen)) 215 223 allocate(psfile(lonlen,latlen,timelen)) 216 224 allocate(tsfile(lonlen,latlen,timelen)) … … 230 238 tfile(:,:,:,:)=0 231 239 tsoilfile(:,:,:,:)=0 232 tfileorig(:,:,:,:)=0 233 ufileorig(:,:,:,:)=0 234 vfileorig(:,:,:,:)=0 240 isoilfile(:,:,:,:)=0 241 dsoilfile(:,:,:,:)=0 242 dsoilvert(:)=0. 243 !tfileorig(:,:,:,:)=0 244 !ufileorig(:,:,:,:)=0 245 !vfileorig(:,:,:,:)=0 235 246 ufile(:,:,:,:)=0 236 247 vfile(:,:,:,:)=0 … … 239 250 waterfile(:,:,:,:)=0 240 251 watericefile(:,:,:,:)=0 241 swaterfile(:,:,:)=0252 !swaterfile(:,:,:)=0 242 253 swatericefile(:,:,:)=0 254 dustfile(:,:,:,:)=0 255 dustnfile(:,:,:,:)=0 243 256 psfile(:,:,:)=0 244 257 tsfile(:,:,:)=0 … … 366 379 ierr = NF_INQ_VARID (nid,"emis",nvarid) 367 380 IF (ierr .NE. NF_NOERR) THEN 368 381 PRINT *, '...warning: not found in diagfi !' 369 382 PRINT *, '...will be filled with a prescribed value', emiss_prescribed 370 emissfile(:,:,:)=emiss_prescribed 383 emissfile(:,:,:)=emiss_prescribed 371 384 ELSE 372 385 #ifdef NC_DOUBLE 373 386 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, emissfile) 374 387 #else 375 388 ierr = NF_GET_VAR_REAL(nid, nvarid, emissfile) 376 389 #endif 377 390 ENDIF … … 380 393 ierr = NF_INQ_VARID (nid,"co2ice",nvarid) 381 394 IF (ierr .NE. NF_NOERR) THEN 382 383 384 co2icefile(:,:,:)=co2ice_prescribed 395 PRINT *, '...warning: not found in diagfi !' 396 PRINT *, '...will be filled with a prescribed value', co2ice_prescribed 397 co2icefile(:,:,:)=co2ice_prescribed 385 398 ELSE 386 399 #ifdef NC_DOUBLE 387 400 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, co2icefile) 388 401 #else 389 402 ierr = NF_GET_VAR_REAL(nid, nvarid, co2icefile) 390 403 #endif 391 404 ENDIF … … 418 431 419 432 420 !! "atmospheric" surface temperature is taken421 !! from original diagfi.nc first level422 !! ... level is ~3-5 meters423 print *,'Near-Surface Temperature'424 ierr = NF_INQ_VARID (nid,"temp",nvarid)425 IF (ierr .NE. NF_NOERR) THEN426 ierr = NF_INQ_VARID (nid,"t",nvarid)427 IF (ierr .NE. NF_NOERR) THEN428 PRINT *, "Error: Readmeteo <temp> not found"429 stop430 ENDIF431 ENDIF432 #ifdef NC_DOUBLE433 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tfileorig)434 #else435 ierr = NF_GET_VAR_REAL(nid, nvarid, tfileorig)436 #endif437 tnsfile=tfileorig(:,:,1,:)438 439 !! "atmospheric" surface u is taken440 !! from original diagfi.nc first level441 !! ... level is ~3-5 meters442 print *,'Near-Surface Zonal Wind'443 ierr = NF_INQ_VARID (nid,"u",nvarid)444 IF (ierr .NE. NF_NOERR) THEN445 PRINT *, "Error: Readmeteo <u> not found"446 stop447 ENDIF448 #ifdef NC_DOUBLE449 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ufileorig)450 #else451 ierr = NF_GET_VAR_REAL(nid, nvarid, ufileorig)452 #endif453 unsfile=ufileorig(:,:,1,:)454 455 !! "atmospheric" surface v is taken456 !! from original diagfi.nc first level457 !! ... level is ~3-5 meters458 print *,'Near-Surface Meridional Wind'459 ierr = NF_INQ_VARID (nid,"v",nvarid)460 IF (ierr .NE. NF_NOERR) THEN461 PRINT *, "Error: Readmeteo <v> not found"462 stop463 ENDIF464 #ifdef NC_DOUBLE465 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vfileorig)466 #else467 ierr = NF_GET_VAR_REAL(nid, nvarid, vfileorig)468 #endif469 vnsfile=vfileorig(:,:,1,:)433 !!!"atmospheric" surface temperature is taken 434 !!!from original diagfi.nc first level 435 !!!... level is ~3-5 meters 436 !print *,'Near-Surface Temperature' 437 ! ierr = NF_INQ_VARID (nid,"temp",nvarid) 438 ! IF (ierr .NE. NF_NOERR) THEN 439 ! ierr = NF_INQ_VARID (nid,"t",nvarid) 440 ! IF (ierr .NE. NF_NOERR) THEN 441 ! PRINT *, "Error: Readmeteo <temp> not found" 442 ! stop 443 ! ENDIF 444 ! ENDIF 445 !#ifdef NC_DOUBLE 446 ! ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tfileorig) 447 !#else 448 ! ierr = NF_GET_VAR_REAL(nid, nvarid, tfileorig) 449 !#endif 450 ! tnsfile=tfileorig(:,:,1,:) 451 452 !!!"atmospheric" surface u is taken 453 !!!from original diagfi.nc first level 454 !!!... level is ~3-5 meters 455 !print *,'Near-Surface Zonal Wind' 456 ! ierr = NF_INQ_VARID (nid,"u",nvarid) 457 ! IF (ierr .NE. NF_NOERR) THEN 458 ! PRINT *, "Error: Readmeteo <u> not found" 459 ! stop 460 ! ENDIF 461 !#ifdef NC_DOUBLE 462 ! ierr = NF_GET_VAR_DOUBLE(nid, nvarid, ufileorig) 463 !#else 464 ! ierr = NF_GET_VAR_REAL(nid, nvarid, ufileorig) 465 !#endif 466 ! unsfile=ufileorig(:,:,1,:) 467 468 !!!"atmospheric" surface v is taken 469 !!!from original diagfi.nc first level 470 !!!... level is ~3-5 meters 471 !print *,'Near-Surface Meridional Wind' 472 ! ierr = NF_INQ_VARID (nid,"v",nvarid) 473 ! IF (ierr .NE. NF_NOERR) THEN 474 ! PRINT *, "Error: Readmeteo <v> not found" 475 ! stop 476 ! ENDIF 477 !#ifdef NC_DOUBLE 478 ! ierr = NF_GET_VAR_DOUBLE(nid, nvarid, vfileorig) 479 !#else 480 ! ierr = NF_GET_VAR_REAL(nid, nvarid, vfileorig) 481 !#endif 482 ! vnsfile=vfileorig(:,:,1,:) 470 483 471 484 SELECT CASE(ident) … … 520 533 ierr = NF_GET_VAR_REAL(nid, nvarid, tfile) 521 534 #endif 535 tnsfile=tfile(:,:,1,:) 522 536 523 537 print *,'Zonal wind' … … 532 546 ierr = NF_GET_VAR_REAL(nid, nvarid, ufile) 533 547 #endif 548 unsfile=ufile(:,:,1,:) 534 549 535 550 print *,'Meridional wind' … … 544 559 ierr = NF_GET_VAR_REAL(nid, nvarid, vfile) 545 560 #endif 561 vnsfile=ufile(:,:,1,:) 546 562 547 563 … … 554 570 write(*,*) "...No q02 - Water vapor set to 0" 555 571 waterfile(:,:,:,:)=0. 556 endif 557 ierr=NF_GET_VAR_REAL(nid,nvarid,waterfile) 572 else 573 ierr=NF_GET_VAR_REAL(nid,nvarid,waterfile) 574 endif 558 575 559 576 print *,'Water ice' … … 562 579 write(*,*) "...No q01 - Water ice set to 0" 563 580 watericefile(:,:,:,:)=0. 581 else 582 ierr=NF_GET_VAR_REAL(nid,nvarid,watericefile) 564 583 endif 565 ierr=NF_GET_VAR_REAL(nid,nvarid,watericefile) 566 567 print *,'Surface Water vapor' 568 ierr=NF_INQ_VARID(nid,"qsurf02",nvarid) 569 if (ierr.ne.NF_NOERR) then 570 write(*,*) "...No qsurf02 - surface Water vapor set to 0" 571 swaterfile(:,:,:)=0. 572 endif 573 ierr=NF_GET_VAR_REAL(nid,nvarid,swaterfile) 584 ! print *,'Surface Water vapor' 585 ! ierr=NF_INQ_VARID(nid,"qsurf02",nvarid) 586 ! if (ierr.ne.NF_NOERR) then 587 ! write(*,*) "...No qsurf02 - surface Water vapor set to 0" 588 ! swaterfile(:,:,:)=0. 589 ! endif 590 ! ierr=NF_GET_VAR_REAL(nid,nvarid,swaterfile) 574 591 575 592 print *,'Surface Water ice' … … 578 595 write(*,*) "...No qsurf01 - surface Water ice set to 0" 579 596 swatericefile(:,:,:)=0. 597 else 598 ierr=NF_GET_VAR_REAL(nid,nvarid,swatericefile) 580 599 endif 581 ierr=NF_GET_VAR_REAL(nid,nvarid,swatericefile)582 600 !!------------------------ 583 601 !! special water stuff 602 !!------------------------ 603 604 !!------------------------ 605 !! special dust stuff 606 !!------------------------ 607 print *,'Dust mass' 608 ierr=NF_INQ_VARID(nid,"dustq",nvarid) 609 if (ierr.ne.NF_NOERR) then 610 write(*,*) "...No dustq - Dust mass set to 0" 611 dustfile(:,:,:,:)=0. 612 else 613 ierr=NF_GET_VAR_REAL(nid,nvarid,dustfile) 614 endif 615 616 print *,'Dust number' 617 ierr=NF_INQ_VARID(nid,"dustN",nvarid) 618 if (ierr.ne.NF_NOERR) then 619 write(*,*) "...No dustN - Dust number set to 0" 620 dustnfile(:,:,:,:)=0. 621 else 622 ierr=NF_GET_VAR_REAL(nid,nvarid,dustnfile) 623 endif 624 !!------------------------ 625 !! special dust stuff 584 626 !!------------------------ 585 627 … … 595 637 tsoilfile(:,:,l,:)=tsfile(:,:,:) 596 638 ENDDO 639 else 640 ierr=NF_GET_VAR_REAL(nid,nvarid,tsoilfile) 597 641 endif 598 ierr=NF_GET_VAR_REAL(nid,nvarid,tsoilfile) 642 643 !!!!!!!! 644 !!!!!!!! new physics (but still compatible with old physics) 645 print *,'Soil depths' 646 ierr=NF_INQ_VARID(nid,"soildepth",nvarid) 647 if (ierr.ne.NF_NOERR) then 648 write(*,*) "...No soildepth - Set to -999" !!! see soil_settings in LMD physics 649 DO l=1,altlen 650 dsoilvert(l)=-999. 651 ENDDO 652 else 653 ierr=NF_GET_VAR_REAL(nid,nvarid,dsoilvert) 654 endif 655 print *, 'wait a minute' !! AS: I know this could be better 656 DO m=1,lonlen 657 DO n=1,latlen 658 DO p=1,timelen 659 dsoilfile(m,n,:,p) = dsoilvert(:) 660 ENDDO 661 ENDDO 662 ENDDO 663 DEALLOCATE(vertdsoil) 664 665 print *,'Soil thermal inertia' 666 ierr=NF_INQ_VARID(nid,"inertiedat",nvarid) 667 if (ierr.ne.NF_NOERR) then 668 write(*,*) "...No soil therm. inert. - Set to -999" 669 DO l=1,altlen 670 isoilfile(:,:,l,:)=-999. 671 ENDDO 672 else 673 ierr=NF_GET_VAR_REAL(nid,nvarid,isoilfile) 674 endif 675 !!!!!!!! 676 !!!!!!!! new physics 599 677 600 678 … … 625 703 ENDIF 626 704 627 628 705 !!----------------------------- 629 706 !! Loop on the written files … … 666 743 !! 1. Surface data 667 744 !!--------------------------------------------- 745 !! 746 !! a mettre pour tous sinon 747 !! WRF_DEBUG: Warning DIM 4 , NAME num_metgrid_levels REDIFINED by 748 !! var DUSTN 26 25 in wrf_io.F90 line 2349 749 !! 668 750 669 751 ! … … 701 783 DESC='Atmospheric temperature' 702 784 XLVL=200100. 703 !SLAB=tsfile(:,:,time_out(l))704 !SLAB=tfileorig(:,:,1,time_out(l))705 785 SLAB=tnsfile(:,:,time_out(l)) 706 786 ! And now put everything in the destination file … … 721 801 DESC='Zonal wind' 722 802 XLVL=200100. 723 !SLAB=ufile(:,:,1,time_out(l))724 !SLAB=ufileorig(:,:,1,time_out(l))725 803 SLAB=unsfile(:,:,time_out(l)) 726 804 ! And now put everything in the destination file … … 741 819 DESC='Meridional wind' 742 820 XLVL=200100. 743 !SLAB=vfile(:,:,1,time_out(l))744 !SLAB=vfileorig(:,:,1,time_out(l))745 821 SLAB=vnsfile(:,:,time_out(l)) 746 822 ! And now put everything in the destination file … … 761 837 DESC='Customized 2D static field' 762 838 XLVL=200100. 763 !SLAB=co2icefile(:,:,time_out(l))764 839 SLAB=vide(:,:) 765 !SLAB=vide(:,:)+ptop766 840 ! And now put everything in the destination file 767 841 ! ... Header … … 853 927 DESC='ZMEA' 854 928 XLVL=200100. 855 !SLAB=vide(:,:)856 929 SLAB=gwparam(:,:,1) 857 930 ! And now put everything in the destination file … … 872 945 DESC='ZSTD' 873 946 XLVL=200100. 874 !SLAB=vide(:,:)875 947 SLAB=gwparam(:,:,2) 876 948 ! And now put everything in the destination file … … 909 981 DESC='Ground temperature' 910 982 XLVL=200100. 911 !SLAB=vide(:,:)912 983 SLAB=tsfile(:,:,time_out(l)) 913 984 ! And now put everything in the destination file … … 928 999 DESC='ZSIG' 929 1000 XLVL=200100. 930 !SLAB=vide(:,:)931 1001 SLAB=gwparam(:,:,3) 932 1002 ! And now put everything in the destination file … … 947 1017 DESC='ZGAM' 948 1018 XLVL=200100. 949 !SLAB=vide(:,:)950 1019 SLAB=gwparam(:,:,4) 951 1020 ! And now put everything in the destination file … … 966 1035 DESC='ZTHE' 967 1036 XLVL=200100. 968 !SLAB=vide(:,:)969 1037 SLAB=gwparam(:,:,5) 970 1038 ! And now put everything in the destination file … … 982 1050 !------------------------! 983 1051 FIELD='SM100200' 984 UNITS=' fraction'985 DESC=' Relative humidity'986 XLVL=200100. 987 SLAB= vide(:,:)1052 UNITS='kg/kg' 1053 DESC='Surf water ice' 1054 XLVL=200100. 1055 SLAB=swatericefile(:,:,time_out(l)) 988 1056 ! And now put everything in the destination file 989 1057 ! ... Header … … 1004 1072 DESC='Water vapor' 1005 1073 XLVL=200100. 1006 !SLAB=waterfile(:,:,1,time_out(l)) 1007 SLAB=swaterfile(:,:,time_out(l)) 1074 SLAB=waterfile(:,:,1,time_out(l)) 1008 1075 ! And now put everything in the destination file 1009 1076 ! ... Header … … 1023 1090 DESC='Water ice' 1024 1091 XLVL=200100. 1025 !SLAB=watericefile(:,:,1,time_out(l)) 1026 SLAB=swatericefile(:,:,time_out(l)) 1092 SLAB=watericefile(:,:,1,time_out(l)) 1027 1093 ! And now put everything in the destination file 1028 1094 ! ... Header … … 1052 1118 !print *,'The field '//DESC//' was written to '//output 1053 1119 1120 !------------------------! 1121 ! >>> Write a variable ! 1122 ! ... Copy&Paste part ! 1123 !------------------------! 1124 FIELD='DSOIL' 1125 UNITS='m' 1126 DESC='Soil depths' 1127 XLVL=200100. 1128 SLAB=dsoilfile(:,:,1,time_out(l)) 1129 ! And now put everything in the destination file 1130 ! ... Header 1131 write(1) IFV 1132 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1133 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1134 ! ... Data 1135 write(1) SLAB 1136 !print *,'The field '//DESC//' was written to '//output 1137 1138 !------------------------! 1139 ! >>> Write a variable ! 1140 ! ... Copy&Paste part ! 1141 !------------------------! 1142 FIELD='ISOIL' 1143 UNITS='tiu' 1144 DESC='Soil thermal inertia' 1145 XLVL=200100. 1146 SLAB=isoilfile(:,:,1,time_out(l)) 1147 ! And now put everything in the destination file 1148 ! ... Header 1149 write(1) IFV 1150 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1151 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1152 ! ... Data 1153 write(1) SLAB 1154 !print *,'The field '//DESC//' was written to '//output 1155 1156 !------------------------! 1157 ! >>> Write a variable ! 1158 ! ... Copy&Paste part ! 1159 !------------------------! 1160 FIELD='DUSTQ' 1161 UNITS='kg/kg' 1162 DESC='Dust mixing ratio' 1163 XLVL=200100. 1164 SLAB=dustfile(:,:,1,time_out(l)) 1165 ! And now put everything in the destination file 1166 ! ... Header 1167 write(1) IFV 1168 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1169 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1170 ! ... Data 1171 write(1) SLAB 1172 !print *,'The field '//DESC//' was written to '//output 1173 1174 !------------------------! 1175 ! >>> Write a variable ! 1176 ! ... Copy&Paste part ! 1177 !------------------------! 1178 FIELD='DUSTN' 1179 UNITS='part/kg' 1180 DESC='Dust number density' 1181 XLVL=200100. 1182 SLAB=dustnfile(:,:,1,time_out(l)) 1183 ! And now put everything in the destination file 1184 ! ... Header 1185 write(1) IFV 1186 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1187 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1188 ! ... Data 1189 write(1) SLAB 1190 !print *,'The field '//DESC//' was written to '//output 1054 1191 1055 1192 … … 1237 1374 !print *,'The field '//DESC//' was written to '//output 1238 1375 1376 !------------------------! 1377 ! >>> Write a variable ! 1378 ! ... Copy&Paste part ! 1379 !------------------------! 1380 FIELD='DSOIL' 1381 UNITS='m' 1382 DESC='Soil depths' 1383 DO k = 1,altlen 1384 XLVL=levels(k) 1385 SLAB=dsoilfile(:,:,k,time_out(l)) 1386 ! And now put everything in the destination file 1387 ! ... Header 1388 write(1) IFV 1389 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1390 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1391 ! ... Data 1392 write(1) SLAB 1393 END DO 1394 !print *,'The field '//DESC//' was written to '//output 1395 1396 !------------------------! 1397 ! >>> Write a variable ! 1398 ! ... Copy&Paste part ! 1399 !------------------------! 1400 FIELD='ISOIL' 1401 UNITS='tiu' 1402 DESC='Soil thermal inertia' 1403 DO k = 1,altlen 1404 XLVL=levels(k) 1405 SLAB=isoilfile(:,:,k,time_out(l)) 1406 ! And now put everything in the destination file 1407 ! ... Header 1408 write(1) IFV 1409 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1410 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1411 ! ... Data 1412 write(1) SLAB 1413 END DO 1414 !print *,'The field '//DESC//' was written to '//output 1415 1416 !------------------------! 1417 ! >>> Write a variable ! 1418 ! ... Copy&Paste part ! 1419 !------------------------! 1420 FIELD='DUSTQ' 1421 UNITS='kg/kg' 1422 DESC='Dust mixing ratio' 1423 DO k = 1,altlen 1424 XLVL=levels(k) 1425 SLAB=dustfile(:,:,k,time_out(l)) 1426 ! And now put everything in the destination file 1427 ! ... Header 1428 write(1) IFV 1429 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1430 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1431 ! ... Data 1432 write(1) SLAB 1433 END DO 1434 !print *,'The field '//DESC//' was written to '//output 1435 1436 !------------------------! 1437 ! >>> Write a variable ! 1438 ! ... Copy&Paste part ! 1439 !------------------------! 1440 FIELD='DUSTN' 1441 UNITS='part/kg' 1442 DESC='Dust number density' 1443 DO k = 1,altlen 1444 XLVL=levels(k) 1445 SLAB=dustnfile(:,:,k,time_out(l)) 1446 ! And now put everything in the destination file 1447 ! ... Header 1448 write(1) IFV 1449 write(1) HDATE,XFCST,SOURCE,FIELD,UNITS,DESC,XLVL,NX,NY,IPROJ 1450 write(1) STARTLOC,STARTLAT,STARTLON,DELTALAT,DELTALON 1451 ! ... Data 1452 write(1) SLAB 1453 END DO 1454 !print *,'The field '//DESC//' was written to '//output 1239 1455 1240 1456 print *,'****done file '//output, int(100.*float(l)/float(FILES)), ' % ' … … 1252 1468 deallocate(tfile) 1253 1469 deallocate(tsoilfile) 1254 deallocate(tfileorig) 1470 deallocate(isoilfile) 1471 deallocate(dsoilfile) 1472 !deallocate(dsoilvert) 1473 !deallocate(tfileorig) 1255 1474 deallocate(ufile) 1256 deallocate(ufileorig)1475 !deallocate(ufileorig) 1257 1476 deallocate(vfile) 1258 deallocate(vfileorig)1477 !deallocate(vfileorig) 1259 1478 deallocate(rfile) 1260 1479 deallocate(hfile) 1261 1480 deallocate(waterfile) 1262 1481 deallocate(watericefile) 1263 deallocate(swaterfile)1482 !deallocate(swaterfile) 1264 1483 deallocate(swatericefile) 1484 deallocate(dustfile) 1485 deallocate(dustnfile) 1265 1486 deallocate(psfile) 1266 1487 deallocate(tsfile) -
trunk/mesoscale/LMD_MM_MARS/SRC/WPS/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase
r11 r72 192 192 flag_in_output=FLAG_SM040100 193 193 ======================================== 194 # WATER ICE ON THE SURFACE 194 195 name=SM100200 195 196 # interp_option=sixteen_pt+four_pt+average_4pt+search -
trunk/mesoscale/LMD_MM_MARS/SRC/WPS/wps_mars/metgrid/METGRID.TBL.ARW_MarsBase_newphys
r55 r72 192 192 flag_in_output=FLAG_SM040100 193 193 ======================================== 194 # WATER ICE ON THE SURFACE 194 195 name=SM100200 195 196 # interp_option=sixteen_pt+four_pt+average_4pt+search -
trunk/mesoscale/LMD_MM_MARS/SRC/WPS/wps_mars/switch_WPS_Mars
r14 r72 23 23 cd metgrid 24 24 \rm METGRID.TBL 2> /dev/null 25 cp ../wps_mars/metgrid/METGRID.TBL.ARW_MarsBase METGRID.TBL.ARW 25 #cp ../wps_mars/metgrid/METGRID.TBL.ARW_MarsBase METGRID.TBL.ARW 26 cp ../wps_mars/metgrid/METGRID.TBL.ARW_MarsBase_newphys METGRID.TBL.ARW 26 27 cd src 27 28 rm module_date_pack.f90 -
trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM
r55 r72 81 81 #### 82 82 state real TSURF ij misc 1 - rhd "TSURF" "SURF TEMPERATURE" "K" #SAVEMARS2 tsurf 83 state real CO2ICE ij misc 1 - r d "CO2ICE" "CO2 GROUND ICE" "kg"#SAVEMARS2 co2ice83 state real CO2ICE ij misc 1 - rhd "CO2ICE" "CO2 GROUND ICE" "kg m-2" #SAVEMARS2 co2ice 84 84 state real EMISSIV ij misc 1 - rd "EMISSIV" "EMISSIVITY" "" #SAVEMARS2 emis 85 85 state real THETA ij misc 1 - rd "THETA" "SLOPE INCLINATION" "deg" #SAVEMARS2 theta_sl … … 90 90 state real SWUP ij misc 1 - rd "SWUP" "UPWARD SW FLUX AT TOP" "W m-2" #SAVEMARS2 fluxtop_sw_tot 91 91 state real LWUP ij misc 1 - rd "LWUP" "UPWARD LW FLUX AT TOP" "W m-2" #SAVEMARS2 fluxtop_lw 92 state real MTOT ij misc 1 - r d"MTOT" "TOTAL MASS WATER VAPOR" "kg m-2" #SAVEMARS2 mtot93 state real ICETOT ij misc 1 - r d"ICETOT" "TOTAL MASS WATER ICE" "kg m-2" #SAVEMARS2 icetot94 state real RAVE ij misc 1 - r d"RAVE" "MEAN ICE RADIUS" "m" #SAVEMARS2 rave92 state real MTOT ij misc 1 - rhd "MTOT" "TOTAL MASS WATER VAPOR" "kg m-2" #SAVEMARS2 mtot 93 state real ICETOT ij misc 1 - rhd "ICETOT" "TOTAL MASS WATER ICE" "kg m-2" #SAVEMARS2 icetot 94 state real RAVE ij misc 1 - rhd "RAVE" "MEAN ICE RADIUS" "m" #SAVEMARS2 rave 95 95 state real RICE ikj misc 1 - rd "RICE" "ICE RADIUS" "m" #SAVEMARS3 rice 96 96 state real HR_SW ikj misc 1 - rd "HR_SW" "HEATING RATE SW" "K/s" #SAVEMARS3 zdtsw 97 97 state real HR_LW ikj misc 1 - rd "HR_LW" "HEATING RATE LW" "K/s" #SAVEMARS3 zdtlw 98 98 state real HR_SH ikj misc 1 - rd "HR_SH" "HEATING RATE sens. heat" "K/s" #SAVEMARS3 zdtdif 99 state real QSURF ij misc 1 - rhd "QSURF" "TRACER AT SURFACE" "kg m-2" #SAVEMARS2 qsurflast 99 100 #### 100 101 #### … … 202 203 state real slpy ij misc 1 - i012rd "SLOPEY" "slope y direction" "rad" 203 204 state real mars_emiss ij misc 1 - i012rd "MARS_EMISS" "emissivity" "0 - 1 fraction" 204 state real mars_cice ij misc 1 - i012rd "MARS_CICE" "co2 ice" "kg" 205 state real mars_cice ij misc 1 - i012rd "MARS_CICE" "co2 ice" "kg/m2" 206 state real mars_wice ij misc 1 - i012rd "MARS_WICE" "h2o ice" "kg/m2" 205 207 state real mars_tsoil ilj misc 1 - i012rd "MARS_TSOIL" "soil temperatures" "K" 206 208 state real mars_isoil ilj misc 1 - i012rd "MARS_ISOIL" "soil thermal inertia" "tiu" -
trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_quarter_ss.F
r11 r72 429 429 grid%mars_emiss(i,j)=0.95 430 430 grid%mars_cice(i,j)=0. 431 grid%mars_wice(i,j)=0. 431 432 grid%slpx(i,j) = 0. 432 433 grid%slpy(i,j) = 0. -
trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F
r63 r72 277 277 grid%mars_emiss(i,j)=grid%st000010(i,j) 278 278 grid%mars_cice(i,j)=grid%st010040(i,j) 279 grid%mars_wice(i,j)=grid%sm100200(i,j) 279 280 !! one more security ... co2ice cannot be negative 280 281 IF (grid%mars_cice(i,j) .lt. 0.) grid%mars_cice(i,j)=0. 282 IF (grid%mars_wice(i,j) .lt. 0.) grid%mars_wice(i,j)=0. 281 283 282 284 DO k = 1, config_flags%num_soil_layers … … 484 486 grid%mars_emiss(i,j) = 0.95 485 487 grid%mars_cice(i,j) = 0. 488 grid%mars_wice(i,j) = 0. 486 489 grid%mars_tsoil(i,:,j)=grid%mars_tsoil(its+1,:,jts+1) 487 490 -
trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F
r55 r72 853 853 & ,MARS_ALB=grid%albedo_gcm,MARS_TI=grid%therm_inert & 854 854 & ,MARS_CICE=grid%mars_cice,MARS_EMISS=grid%mars_emiss & 855 & ,MARS_WICE=grid%mars_wice & 855 856 & ,MARS_TSOIL=grid%mars_tsoil & 856 857 #ifdef NEWPHYS -
trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd/libf/phymars/meso_physiq.F
r54 r72 184 184 REAL ust(ngridmx) !! pour LES avec isfflx!=0 185 185 LOGICAL flag_LES !! pour LES avec isfflx!=0 186 REAL qsurflast(ngridmx) !! pour diagnostics 186 187 c ****WRF 187 188 REAL pday … … 1496 1497 wtsurf(ig) = tsurf(ig) !! surface temperature 1497 1498 wco2ice(ig) = co2ice(ig) !! co2 ice 1499 1500 !!! TEMP TEMP TEMP TEMP TEMP TEMP TEMP 1501 !!! specific to WRF WRF WRF 1502 !!! just to output water ice on surface 1503 !!! [it might not be water ice on surface but OK] 1504 !!! uncomment the Registry entry 1505 qsurflast(ig) = qsurf(ig,nqmx) 1506 1498 1507 enddo 1499 1508 c -
trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F
r70 r72 30 30 MARS_MODE, & 31 31 MARS_ALB,MARS_TI,MARS_CICE,MARS_EMISS, & 32 MARS_WICE, & 32 33 MARS_TSOIL, & 33 34 #ifdef NEWPHYS … … 109 110 XLAT,XLONG,HT, & 110 111 MARS_ALB,MARS_TI,MARS_EMISS,MARS_CICE, & 112 MARS_WICE, & 111 113 SLPX,SLPY 112 114 ! 3D arrays … … 440 442 !ENDIF 441 443 442 print *, 'check dynamics'443 !!! in some cases, weird values are displayed444 !!! despite the fact that outputs are OK...445 !print *, 'u', MAXVAL(u), MINVAL(u)446 !print *, 'v', MAXVAL(v), MINVAL(v)447 !print *, 'w', MAXVAL(w), MINVAL(w)448 !print *, 't', MAXVAL(t), MINVAL(t, MASK = t > 0)449 print *, 'u', u(10,1,10), u(10,15,10)450 print *, 'v', v(10,1,10), v(10,15,10)451 print *, 'w', w(10,1,10), w(10,15,10)452 print *, 't', t(10,1,10), t(10,15,10)444 !print *, 'check dynamics' 445 ! !!! in some cases, weird values are displayed 446 ! !!! despite the fact that outputs are OK... 447 ! !print *, 'u', MAXVAL(u), MINVAL(u) 448 ! !print *, 'v', MAXVAL(v), MINVAL(v) 449 ! !print *, 'w', MAXVAL(w), MINVAL(w) 450 ! !print *, 't', MAXVAL(t), MINVAL(t, MASK = t > 0) 451 !print *, 'u', u(10,1,10), u(10,15,10) 452 !print *, 'v', v(10,1,10), v(10,15,10) 453 !print *, 'w', w(10,1,10), w(10,15,10) 454 !print *, 't', t(10,1,10), t(10,15,10) 453 455 454 456 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 786 788 787 789 !-------------------! 790 ! Tracer at surface ! 791 !-------------------! 792 #ifdef NEWPHYS 793 !!! a faire !!! 794 PRINT *, 'WARNING WARNING no tracer at surface' 795 qsurf_val(:)=0. 796 #else 797 SELECT CASE (MARS_MODE) 798 CASE(0) !! NO TRACERS (mars=0) 799 qsurf_val(:)=0. 800 CASE(1) !! WATER CYCLE (mars=1) 801 qsurf_val(2)=MARS_WICE(i,j) !! attention... H2O ice is tracer nqmx in qsurf in LMD physics 802 qsurf_val(1)=0. 803 CASE(2) !! DUST CYCLE (mars=2) 804 qsurf_val(:)=0. 805 END SELECT 806 #endif 807 808 !-------------------! 788 809 ! Slope inclination ! 789 810 !-------------------! … … 832 853 PRINT *,'v_prof ',v_prof 833 854 PRINT *,'tsoil ',tsoil_val 855 PRINT *,'qsurf ',qsurf_val 834 856 #ifdef NEWPHYS 835 857 PRINT *,'isoil ',isoil_val … … 844 866 !-------------------------! 845 867 !-------------------------! 846 q2_val(:)=0 !PBL wind variance 847 qsurf_val(:)=0 !Tracer on surface 868 q2_val(:)=0. !PBL wind variance 848 869 849 870 !-----------------! … … 1167 1188 !!PRINT *, 'min',MINVAL(RUBLTEN, MASK=RUBLTEN/=0.),& 1168 1189 !! ' at',MINLOC(RUBLTEN, MASK=RUBLTEN/=0.) 1169 PRINT *, RUBLTEN(10,1,10), RUBLTEN(10,15,10)1190 !PRINT *, RUBLTEN(10,1,10), RUBLTEN(10,15,10) 1170 1191 PRINT *, 'v non-zero tendencies' 1171 1192 !!PRINT *, 'max',MAXVAL(RVBLTEN, MASK=RVBLTEN/=0.),& … … 1173 1194 !!PRINT *, 'min',MINVAL(RVBLTEN, MASK=RVBLTEN/=0.),& 1174 1195 !! ' at',MINLOC(RVBLTEN, MASK=RVBLTEN/=0.) 1175 PRINT *, RVBLTEN(10,1,10), RVBLTEN(10,15,10)1196 !PRINT *, RVBLTEN(10,1,10), RVBLTEN(10,15,10) 1176 1197 !!! STOP IF CRASH 1177 1198 !IF (MAXVAL(RUBLTEN, MASK=RUBLTEN/=0.) == 0.) STOP -
trunk/mesoscale/NOTES.txt
r51 r72 1 2 - attention il faut les trois MARS sinon il s arrete sans message clair 3 - attention a ne pas lancer le modele s il est deja lance 4 1 5 2 6 ROUTINES a AJOUTER sont dans COMMON_GCM
Note: See TracChangeset
for help on using the changeset viewer.