Changeset 826 for trunk/LMDZ.TITAN/Tools
- Timestamp:
- Oct 30, 2012, 12:18:36 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/Tools/angmom.F90
r819 r826 16 16 ! or if simple friction 17 17 ! tdyn -- 1D -- Dynamics torque IF dudyn is present 18 ! tajs -- 1D -- Torque from convective adjustment IF dudyn is present 18 19 ! tgwo -- 1D -- Orographic GW torque IF dugwo is present 19 20 ! tgwno -- 1D -- Non-Orographic GW torque IF dugwno is present … … 23 24 ! - surface pressure and surface geopotential 24 25 ! - zonal wind 25 ! Optional: dudyn, duvdf, du gwo, dugwno (acceleration terms from physiq param)26 ! Optional: dudyn, duvdf, duajs, dugwo, dugwno (acceleration terms from physiq param) 26 27 27 28 implicit none … … 67 68 real,dimension(:,:,:,:),allocatable :: duvdf ! Friction in BL 68 69 real,dimension(:,:,:,:),allocatable :: dudyn ! Dynamics 70 real,dimension(:,:,:,:),allocatable :: duajs ! Convective adjustment 69 71 real,dimension(:,:,:,:),allocatable :: dugwo ! Orographic Gravity Waves 70 72 real,dimension(:,:,:,:),allocatable :: dugwno ! Non-Orographic Gravity Waves … … 84 86 real,dimension(:),allocatable :: tmou ! mountain torque (kg m2/s2) 85 87 real,dimension(:),allocatable :: tdyn ! dynamics torque (kg m2/s2) 88 real,dimension(:),allocatable :: tajs ! convective adjustment torque (kg m2/s2) 86 89 real,dimension(:),allocatable :: tbls ! friction torque (kg m2/s2) 87 90 real,dimension(:),allocatable :: tgwo ! oro GW torque (kg m2/s2) … … 99 102 integer i,j,ilon,ilat,ilev,itim ! for loops 100 103 integer idlsurf ! for option ideal surface 101 logical :: flag_duvdf,flag_dudyn,flag_du gwo,flag_dugwno,lmdflag,dzflag104 logical :: flag_duvdf,flag_dudyn,flag_duajs,flag_dugwo,flag_dugwno,lmdflag,dzflag 102 105 103 106 real :: deltalat,deltalon ! lat and lon intervals in radians … … 236 239 allocate(phis(lonlength,latlength)) 237 240 238 if(lmdflag) then239 text="psol"240 else241 241 text="PS" 242 endif243 242 call get_var3d(infid,lonlength,latlength,timelength,text,ps,ierr1,ierr2) 244 243 if (ierr1.ne.NF_NOERR) then 245 write(*,*) " looking for ps instead... "246 text="ps "244 write(*,*) " looking for psol instead... " 245 text="psol" 247 246 call get_var3d(infid,lonlength,latlength,timelength,text,ps,ierr1,ierr2) 248 if (ierr1.ne.NF_NOERR) stop "Error: Failed to get ps ID"247 if (ierr1.ne.NF_NOERR) stop "Error: Failed to get psol ID" 249 248 endif 250 249 if (ierr2.ne.NF_NOERR) stop "Error: Failed reading surface pressure" … … 374 373 else ! lmdflag 375 374 print*,"dugwo and dugwno not in CAM simulations" 375 flag_dugwo = .false. 376 flag_dugwno = .false. 377 endif ! lmdflag 378 379 !=============================================================================== 380 ! 2.1.65 Accelerations from convective adjustment 381 !=============================================================================== 382 allocate(duajs(lonlength,latlength,altlength,timelength)) 383 384 if(lmdflag) then 385 386 text="duajs" 387 call get_var4d(infid,lonlength,latlength,altlength,timelength,text,duajs,ierr1,ierr2) 388 if (ierr1.ne.NF_NOERR) then 389 write(*,*) "Failed to get duajs ID" 390 flag_duajs = .false. 391 else 392 if (ierr2.ne.NF_NOERR) stop "Error: Failed reading duajs" 393 flag_duajs = .true. 394 endif 395 396 else ! lmdflag 397 print*,"duajs not in CAM simulations" 398 flag_duajs = .false. 376 399 endif ! lmdflag 377 400 … … 518 541 519 542 !=============================================================================== 520 ! 2.2.5 Mountain, friction, dynamics and GW torques543 ! 2.2.5 Mountain, friction, convective adjustment, dynamics and GW torques 521 544 !=============================================================================== 522 545 allocate(tmou(timelength)) 523 546 if (flag_dudyn) allocate(tdyn(timelength)) 547 if (flag_duajs) allocate(tajs(timelength)) 524 548 if (flag_duvdf) allocate(tbls(timelength)) 525 549 if (flag_dugwo) allocate(tgwo(timelength)) … … 559 583 enddo 560 584 if (tdyn(itim).eq.0.) tdyn(itim) = miss_val 585 endif 586 587 if (flag_duajs) then 588 tajs(itim) = 0. 589 do ilon=1,lonlength 590 do ilat=1,latlength 591 do ilev=1,altlength 592 if (rayon(ilon,ilat,ilev,itim).ne.miss_val) then 593 tajs(itim) = tajs(itim) + duajs(ilon,ilat,ilev,itim) & 594 * rayon(ilon,ilat,ilev,itim)*cos(latrad(ilat)) & 595 * dmass(ilon,ilat,ilev,itim) & 596 / hadley 597 endif 598 enddo 599 enddo 600 enddo 601 if (tajs(itim).eq.0.) tajs(itim) = miss_val 561 602 endif 562 603 … … 682 723 !=============================================================================== 683 724 725 ! Check variables to output 726 727 do itim=1,timelength 728 if (flag_dudyn .and.( tdyn(itim).eq.miss_val)) flag_dudyn =.false. 729 if (flag_duajs .and.( tajs(itim).eq.miss_val)) flag_duajs =.false. 730 if (flag_duvdf .and.( tvdf(itim).eq.miss_val)) flag_duvdf =.false. 731 if (flag_dugwo .and.( tgwo(itim).eq.miss_val)) flag_dugwo =.false. 732 if (flag_dugwno.and.(tgwno(itim).eq.miss_val)) flag_dugwno=.false. 733 enddo ! timelength 734 735 if(dzflag) then 736 do itim=1,timelength 737 if (tdyndz(itim).eq.miss_val) dzflag=.false. 738 if (tdisdz(itim).eq.miss_val) dzflag=.false. 739 if (tspgdz(itim).eq.miss_val) dzflag=.false. 740 if (tphydz(itim).eq.miss_val) dzflag=.false. 741 enddo ! timelength 742 endif ! dzflag 743 744 684 745 ! 1D Variables 685 746 … … 702 763 "tdyn ", "Dynamics torque ","E18kgm2s-2",miss_val,& 703 764 tdyn ) 765 endif 766 767 if (flag_duajs) then 768 call write_var1d(outfid,datashape1d,timelength,& 769 "tajs ", "Dynamics torque ","E18kgm2s-2",miss_val,& 770 tajs ) 704 771 endif 705 772
Note: See TracChangeset
for help on using the changeset viewer.