Changeset 3021
- Timestamp:
- Jul 31, 2023, 5:49:13 PM (16 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3018 r3021 4152 4152 (could not turn nlte_aux.F, nlte_setup.F and nlte_calc.F into modules due 4153 4153 to circular dependencies; would require further code reorganization). 4154 4155 == 31/07/2023 == JBC 4156 Addition in 1D of relaxation towards a profile for atmospheric water. It needs the flag "atm_wat_tau" (real): 4157 - atm_wat_profile < 0. -> no relaxation (default); 4158 - atm_wat_profile >= 0. -> relaxation towards the value "atm_wat_profile" with relaxation time "atm_wat_tau". -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
r3004 r3021 142 142 c JN : Force atmospheric water profiles 143 143 REAL atm_wat_profile 144 REAL atm_wat_tau 144 145 REAL,ALLOCATABLE :: zqsat(:) ! useful for (atm_wat_profile=2) 145 146 … … 813 814 c --------------------------------------------------- 814 815 ! Adding an option to force atmospheric water values JN 815 atm_wat_profile =-1! Default: free atm wat profile816 print *,'Force atmospheric water vapor profile 816 atm_wat_profile = -1. ! Default: free atm wat profile 817 print *,'Force atmospheric water vapor profile?' 817 818 call getin("atm_wat_profile",atm_wat_profile) 818 819 write(*,*) "atm_wat_profile = ", atm_wat_profile 819 if (a tm_wat_profile.EQ.-1) then820 if (abs(atm_wat_profile + 1.) < 1.e-15) then ! if == -1. 820 821 write(*,*) "Free atmospheric water vapor profile" 821 write(*,*) "Total water is conserved on the column"822 else if (a tm_wat_profile.EQ.0) then822 write(*,*) "Total water is conserved in the column" 823 else if (abs(atm_wat_profile) < 1.e-15) then ! if == 0. 823 824 write(*,*) "Dry atmospheric water vapor profile" 824 else if ( (atm_wat_profile.GT.0).and.(atm_wat_profile.LE.1)) then825 write(*,*) "Prescribed atmospheric water vapor MMRprofile"825 else if (0. < atm_wat_profile .and. atm_wat_profile <= 1.) then 826 write(*,*) "Prescribed atmospheric water vapor profile" 826 827 write(*,*) "Unless it reaches saturation (maximal value)" 827 write(*,*) "MMR chosen : ", atm_wat_profile 828 endif 828 else 829 write(*,*) 'Water vapor profile value not correct!' 830 stop 831 endif 832 833 ! Check if the atmospheric water profile relaxation is specified 834 ! -------------------------------------------------------------- 835 ! Adding an option to relax atmospheric water values JBC 836 atm_wat_tau = -1. ! Default: no time relaxation 837 print*, 'Relax atmospheric water vapor profile?' 838 call getin("atm_wat_tau",atm_wat_tau) 839 write(*,*) "atm_wat_tau = ", atm_wat_tau 840 if (atm_wat_tau < 0.) then 841 write(*,*) "Atmospheric water vapor profile is not relaxed" 842 else 843 if (0. <= atm_wat_profile .and. atm_wat_profile <= 1.) then 844 write(*,*) "Relaxed atmospheric water vapor profile towards ", 845 & atm_wat_profile 846 write(*,*) "Unless it reaches saturation (maximal value)" 847 else 848 write(*,*) 'Reference atmospheric water vapor profile not known!' 849 write(*,*) 'Please, specify atm_wat_profile' 850 stop 851 endif 852 endif 829 853 830 854 c Write a "startfi" file … … 881 905 ENDDO 882 906 883 ! Forceatmospheric water if asked884 ! Added "atm_wat_profile" flag (JN )885 ! ------------------------------------- 907 ! Modify atmospheric water if asked 908 ! Added "atm_wat_profile" flag (JN + JBC) 909 ! --------------------------------------- 886 910 call watersat(nlayer,temp,play,zqsat) 887 911 if (0. <= atm_wat_profile .and. atm_wat_profile <= 1.) then 888 q(:,igcm_h2o_vap) = min(zqsat(:),atm_wat_profile) 889 ! write(*,*) "prescribed atm_wat_profile (wet if >0, dry if =0)" 890 q(:,igcm_h2o_ice) = 0. 891 ! write(*,*) "atm_wat_profile: reset h2o ice" 912 ! If atmospheric water is monitored 913 if (atm_wat_tau < 0.) then ! Prescribed atm_wat_profile 914 ! Wet if >0, Dry if =0 915 q(:,igcm_h2o_vap) = min(zqsat(:),atm_wat_profile*g/psurf) 916 q(:,igcm_h2o_ice) = 0. ! reset h2o ice 917 else ! Relaxation towards the value atm_wat_profile with relaxation time atm_wat_tau 918 q(:,igcm_h2o_vap) = atm_wat_profile*g/psurf + (q(:,igcm_h2o_vap) 919 & - atm_wat_profile*g/psurf)*dexp(-dtphys/atm_wat_tau) 920 q(:,igcm_h2o_vap) = min(zqsat(:),q(:,igcm_h2o_vap)) 921 q(:,igcm_h2o_ice) = 0. ! reset h2o ice 922 endif 892 923 endif 893 ! CALL write_output('qsat',894 ! & 'qsat',895 ! & 'kg/kg',zqsat)896 ! CALL write_output('qvap',897 ! & 'qvap',898 ! & 'kg/kg',q(:,igcm_h2o_vap))899 900 924 901 925 ! write(*,*) "testphys1d avant q", q(1,:) … … 912 936 ! write(*,*) "testphys1d apres q", q(1,:) 913 937 914 915 938 c wind increment : specific for 1D 916 939 c -------------------------------- 917 918 940 c The physics compute the tendencies on u and v, 919 941 c here we just add Coriolos effect … … 931 953 ENDDO 932 954 c end if 933 c 934 c 955 935 956 c Compute time for next time step 936 957 c --------------------------------------- … … 953 974 c compute pressure for next time step 954 975 c ---------------------------------------------------------- 955 956 976 psurf=psurf+dtphys*dpsurf(1) ! surface pressure change 957 977 DO ilevel=1,nlevel … … 968 988 ENDDO 969 989 ENDDO 970 971 990 ENDDO ! of idt=1,ndt ! end of time stepping loop 972 991 973 992 ! update the profiles files at the end of the run 974 993 write_prof=.false.
Note: See TracChangeset
for help on using the changeset viewer.