Changeset 1161 for trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
- Timestamp:
- Jan 21, 2014, 4:07:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r1157 r1161 199 199 character*80 fichier 200 200 integer l,ig,ierr,iq,iaer 201 201 202 202 !!! this is saved for diagnostic 203 203 real,dimension(:),allocatable,save :: fluxsurf_lw ! incident LW (IR) surface flux (W.m-2) … … 411 411 logical,save :: ice_update 412 412 413 ! included by MS to compute the daily average of rings shadowing 414 integer, parameter :: nb_hours = 1536 ! set how many times per day are used 415 real :: pas 416 integer :: m 417 ! temporary variables computed at each step of this average 418 real :: ptime_day ! Universal time in sol fraction 419 real :: tmp_zls ! solar longitude 420 real, dimension(:), allocatable :: tmp_fract ! day fraction of the time interval 421 real, dimension(:), allocatable :: tmp_mu0 ! equivalent solar angle 413 422 !======================================================================= 414 423 … … 455 464 ALLOCATE(tau_col(ngrid)) 456 465 457 !! this is defined in comsaison_h 458 ALLOCATE(mu0(ngrid)) 459 ALLOCATE(fract(ngrid)) 460 466 !! this is defined in comsaison_h 467 ALLOCATE(mu0(ngrid)) 468 ALLOCATE(fract(ngrid)) 469 470 461 471 !! this is defined in radcommon_h 462 472 ALLOCATE(eclipse(ngrid)) … … 681 691 ztim1=SIN(declin) 682 692 ! ztim2=COS(declin)*COS(2.*pi*(zday/year_day) - zls*nres) 683 ! ztim3=-COS(declin)*SIN(2. *pi*(zday/year_day) - zls*nres)693 ! ztim3=-COS(declin)*SIN(2. zday/year_day) - zls*nres) 684 694 ! JL12 corrects tidally resonant cases. nres=omega_rot/omega_orb 685 695 ztim2=COS(declin)*COS(2.*pi*(zday/year_day)*nres - zls) … … 696 706 call stelang(ngrid,sinlon,coslon,sinlat,coslat, & 697 707 ztim1,ztim2,ztim3,mu0,fract) 698 699 else 708 else if(diurnal .eq. .false.) then 700 709 701 710 call mucorr(ngrid,declin,lati,mu0,fract,10000.,rad) 702 703 endif 704 711 ! write(*,*) 'mu0 =', mu0 712 ! write(*,*) 'hello, l 738' 713 ! WARNING: this function appears not to work in 1D 714 715 endif 716 705 717 !! Eclipse incoming sunlight (e.g. Saturn ring shadowing) 706 if (rings_shadow) then 707 if (diurnal) then 708 call rings(ngrid, declin, ptime, rad, 0., eclipse) 709 call writediagfi(ngrid,"shad","rings"," ", 2, 1.-eclipse) 710 write(*,*) "Ring shadow activated." 711 else 712 write(*,*) "Ring shadow + diurnal=F not supported yet." 713 endif 714 else 715 eclipse(:) = 0.0 716 endif 718 719 if(rings_shadow) then 720 write(*,*) 'Rings shadow activated' 721 if(diurnal .eq. .false.) then ! we need to compute the daily average insolation 722 pas = 1./nb_hours 723 ptime_day = 0. 724 fract(:) = 0. 725 ALLOCATE(tmp_fract(ngrid)) 726 ALLOCATE(tmp_mu0(ngrid)) 727 tmp_fract(:) = 0. 728 eclipse(:) = 0. 729 tmp_mu0(:) = 0. 730 731 do m=1, nb_hours 732 ptime_day = m*pas 733 call stellarlong(pday+ptime_day,tmp_zls) 734 call orbite(tmp_zls,dist_star,declin) 735 ztim1=SIN(declin) 736 ztim2=COS(declin)*COS(2.*pi*(pday+ptime_day-.5)) 737 ztim3=-COS(declin)*SIN(2.*pi*(pday+ptime_day-.5)) 738 739 call stelang(ngrid,sinlon,coslon,sinlat,coslat, & 740 ztim1,ztim2,ztim3,tmp_mu0,tmp_fract) 741 742 call rings(ngrid, declin, ptime_day, rad, 0., eclipse) 743 744 fract(:) = fract(:) + (1.-eclipse(:))*tmp_fract(:) !! fract prend en compte l'ombre des anneaux et l'alternance jour/nuit 745 enddo 746 747 DEALLOCATE(tmp_fract) 748 DEALLOCATE(tmp_mu0) 749 750 fract(:) = fract(:)/nb_hours 751 752 else 753 call rings(ngrid, declin, ptime, rad, 0., eclipse) 754 fract(:) = fract(:) * (1.-eclipse) 755 endif 756 else 757 eclipse(:) = 0.0 758 endif 759 717 760 718 761 if (corrk) then … … 1431 1474 if(corrk)then 1432 1475 1476 if(ISNAN(sum(fluxtop_dn))) then 1477 write(*,*) 'err fluxtop_dn' 1478 else if(ISNAN(sum(area))) then 1479 write(*,*) 'err area' 1480 else if(ISNAN(totarea)) then 1481 write(*,*) 'area is nan' 1482 endif 1483 1433 1484 ISR = SUM(area(:)*fluxtop_dn(:))/totarea 1434 1485 ASR = SUM(area(:)*fluxabs_sw(:))/totarea … … 1717 1768 call writediagfi(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw) 1718 1769 call writediagfi(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw) 1770 call writediagfi(ngrid,"shad","rings"," ", 2, fract) 1719 1771 ! call writediagfi(ngrid,"ASRcs","absorbed stellar rad (cs).","W m-2",2,fluxabs_sw1) 1720 1772 ! call writediagfi(ngrid,"OLRcs","outgoing longwave rad (cs).","W m-2",2,fluxtop_lw1) … … 1868 1920 !! this is defined in comsaison_h 1869 1921 IF ( ALLOCATED(mu0)) DEALLOCATE(mu0) 1922 1870 1923 IF ( ALLOCATED(fract)) DEALLOCATE(fract) 1924 1925 1926 !! this is defined in radcommon_h 1927 IF ( ALLOCATED(eclipse)) DEALLOCATE(eclipse) 1871 1928 1872 1929 !! this is defined in comsoil_h
Note: See TracChangeset
for help on using the changeset viewer.