Changeset 3336 for trunk/LMDZ.MARS/libf
- Timestamp:
- May 21, 2024, 1:32:02 PM (7 months ago)
- Location:
- trunk/LMDZ.MARS/libf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F
r3316 r3336 58 58 use comslope_mod, ONLY: nslope,def_slope,def_slope_mean, 59 59 & subslope_dist,end_comslope_h,ini_comslope_h 60 USE subslope_mola_mod, ONLY: subslope_mola 60 use paleoclimate_mod, only: h2o_ice_depth, lag_co2_ice, d_coef, 61 & ini_paleoclimate_h, end_paleoclimate_h 62 use subslope_mola_mod, ONLY: subslope_mola 61 63 62 64 implicit none … … 192 194 ! sub-grid cloud fraction 193 195 real :: totcloudfrac(ngridmx) 194 !Variable to change the number of subslope 195 REAL, ALLOCATABLE :: default_def_slope(:) 196 REAL,ALLOCATABLE :: tsurf_old_slope(:,:) ! Surface temperature (K) 197 REAL,ALLOCATABLE :: emis_old_slope(:,:) ! Thermal IR surface emissivity 198 REAL,ALLOCATABLE :: qsurf_old_slope(:,:,:) ! tracer on surface (e.g. kg.m-2) 199 REAL,ALLOCATABLE :: watercap_old_slope(:,:) ! Surface water ice (kg.m-2) 200 REAL,ALLOCATABLE :: perennial_co2_old_slope(:,:) ! Surface water ice (kg.m-2) 201 REAL,ALLOCATABLE :: tsoil_old_slope(:,:,:) 202 REAL,ALLOCATABLE :: inertiesoil_old_slope(:,:,:) 203 REAL,ALLOCATABLE :: albedo_old_slope(:,:,:) ! Surface albedo in each solar band 204 REAL,ALLOCATABLE :: flux_geo_old_slope(:,:) 205 integer :: iflat 206 integer :: nslope_old, nslope_new 196 ! Variables to change the number of subslope 197 real, allocatable, dimension(:) :: default_def_slope 198 real, allocatable, dimension(:,:) :: tsurf_old_slope ! Surface temperature (K) 199 real, allocatable, dimension(:,:) :: emis_old_slope ! Thermal IR surface emissivity 200 real, allocatable, dimension(:,:,:) :: qsurf_old_slope ! tracer on surface (e.g. kg.m-2) 201 real, allocatable, dimension(:,:) :: watercap_old_slope ! Surface water ice (kg.m-2) 202 real, allocatable, dimension(:,:) :: perennial_co2_old_slope ! Surface water ice (kg.m-2) 203 real, allocatable, dimension(:,:,:) :: tsoil_old_slope 204 real, allocatable, dimension(:,:,:) :: inertiesoil_old_slope 205 real, allocatable, dimension(:,:,:) :: albedo_old_slope ! Surface albedo in each solar band 206 real, allocatable, dimension(:,:) :: flux_geo_old_slope 207 real, allocatable, dimension(:,:) :: h2o_ice_depth_old_slope 208 real, allocatable, dimension(:,:) :: lag_co2_ice_old_slope 209 real, allocatable, dimension(:,:) :: d_coef_old_slope 210 integer :: iflat, nslope_old, nslope_new 207 211 208 212 … … 1735 1739 write(*,*) 'set a new number of subgrid scale slopes' 1736 1740 write(*,*) 'Current value=', nslope 1737 write(*,*) 'Enter value for nslope (ex: 1, 5,7)?'1741 write(*,*) 'Enter value for nslope (ex: 1,3,5,7)?' 1738 1742 ierr=1 1739 1743 do while (ierr.ne.0) … … 1744 1748 write(*,*) 'You can go grab a coffee and relax a bit' 1745 1749 1746 if (nslope.eq.nslope_new) then1750 if (nslope == nslope_new) then 1747 1751 write(*,*) 'The number of subslope you entered is the same' 1748 1752 write(*,*) 'as the number written in startfi.nc. ' … … 1798 1802 1799 1803 iflat = 1 1800 DO islope=2,nslope_new1801 IF(abs(def_slope_mean(islope)).lt.1802 & abs(def_slope_mean(iflat))) THEN1804 do islope = 2,nslope_new 1805 if (abs(def_slope_mean(islope)) < 1806 & abs(def_slope_mean(iflat))) then 1803 1807 iflat = islope 1804 ENDIF1805 ENDDO1808 endif 1809 enddo 1806 1810 1807 1811 if (ngridmx /= 1) then … … 1815 1819 allocate(watercap_old_slope(ngridmx,nslope_old)) 1816 1820 allocate(perennial_co2_old_slope(ngridmx,nslope_old)) 1817 1818 1821 tsurf_old_slope(:,:)=tsurf(:,:) 1819 1822 qsurf_old_slope(:,:,:)=qsurf(:,:,:) … … 1828 1831 allocate(inertiesoil_old_slope(ngridmx,nsoilmx,nslope_old)) 1829 1832 allocate(flux_geo_old_slope(ngridmx,nslope_old)) 1830 1831 1833 inertiesoil_old_slope(:,:,:)=inertiesoil(:,:,:) 1832 1834 tsoil_old_slope(:,:,:)=tsoil(:,:,:) 1833 1835 flux_geo_old_slope(:,:)=flux_geo(:,:) 1834 1835 1836 call end_comsoil_h_slope_var 1836 1837 call ini_comsoil_h_slope_var(ngridmx,nslope_new) … … 1839 1840 allocate(albedo_old_slope(ngridmx,2,nslope_old)) 1840 1841 albedo_old_slope(:,:,:)=albedo(:,:,:) 1841 1842 1842 call end_dimradmars_mod_slope_var 1843 1843 call ini_dimradmars_mod_slope_var(ngridmx,nslope_new) 1844 1844 1845 if(nslope_old.eq.1 .and. nslope_new.gt.1) then 1846 do islope=1,nslope_new 1847 tsurf(:,islope)=tsurf_old_slope(:,1) 1848 qsurf(:,:,islope)=qsurf_old_slope(:,:,1) 1849 emis(:,islope)=emis_old_slope(:,1) 1850 watercap(:,islope)=watercap_old_slope(:,1) 1851 perennial_co2ice(:,islope)= perennial_co2_old_slope(:,1) 1852 tsoil(:,:,islope)=tsoil_old_slope(:,:,1) 1853 albedo(:,:,islope)=albedo_old_slope(:,:,1) 1854 inertiesoil(:,:,islope)=inertiesoil_old_slope(:,:,1) 1855 flux_geo(:,islope)=flux_geo_old_slope(:,1) 1856 enddo 1857 elseif(nslope_new.eq.1) then 1858 tsurf(:,1)=tsurf_old_slope(:,iflat) 1859 qsurf(:,:,1)=qsurf_old_slope(:,:,iflat) 1860 emis(:,1)=emis_old_slope(:,iflat) 1861 watercap(:,1)=watercap_old_slope(:,iflat) 1862 perennial_co2ice(:,islope)= 1863 & perennial_co2_old_slope(:,iflat) 1864 tsoil(:,:,1)=tsoil_old_slope(:,:,iflat) 1865 albedo(:,:,1)=albedo_old_slope(:,:,iflat) 1866 inertiesoil(:,:,1)=inertiesoil_old_slope(:,:,iflat) 1867 flux_geo(:,1)=flux_geo_old_slope(:,iflat) 1868 elseif(nslope_old.eq.5 .and. nslope_new.eq.7) then 1869 do islope=1,nslope_new 1870 tsurf(:,islope)=tsurf_old_slope(:,iflat) 1871 qsurf(:,:,islope)=qsurf_old_slope(:,:,iflat) 1872 emis(:,islope)=emis_old_slope(:,iflat) 1873 watercap(:,islope)=watercap_old_slope(:,iflat) 1874 perennial_co2ice(:,islope)= 1875 & perennial_co2_old_slope(:,iflat) 1876 tsoil(:,:,islope)=tsoil_old_slope(:,:,iflat) 1877 albedo(:,:,islope)=albedo_old_slope(:,:,iflat) 1878 inertiesoil(:,:,islope)=inertiesoil_old_slope(:,:,iflat) 1879 flux_geo(:,islope)=flux_geo_old_slope(:,iflat) 1880 enddo 1881 elseif(nslope_old.eq.7 .and. nslope_new.eq.5) then 1882 do islope=1,nslope_new 1883 tsurf(:,islope)=tsurf_old_slope(:,iflat) 1884 qsurf(:,:,islope)=qsurf_old_slope(:,:,iflat) 1885 emis(:,islope)=emis_old_slope(:,iflat) 1886 watercap(:,islope)=watercap_old_slope(:,iflat) 1887 perennial_co2ice(:,islope)= 1888 & perennial_co2_old_slope(:,iflat) 1889 tsoil(:,:,islope)=tsoil_old_slope(:,:,iflat) 1890 albedo(:,:,islope)=albedo_old_slope(:,:,iflat) 1891 inertiesoil(:,:,islope)=inertiesoil_old_slope(:,:,iflat) 1892 flux_geo(:,islope)=flux_geo_old_slope(:,iflat) 1845 ! Paleoclimate related stuff 1846 allocate(h2o_ice_depth_old_slope(ngridmx,nslope_old)) 1847 allocate(lag_co2_ice_old_slope(ngridmx,nslope_old)) 1848 allocate(d_coef_old_slope(ngridmx,nslope_old)) 1849 h2o_ice_depth_old_slope = h2o_ice_depth 1850 lag_co2_ice_old_slope = lag_co2_ice 1851 d_coef_old_slope = d_coef 1852 call end_paleoclimate_h 1853 call ini_paleoclimate_h(ngridmx,nslope_new) 1854 1855 ! Update of the variables with the new "slopes" situation according to the old one 1856 if (nslope_old == 1) then 1857 do islope = 1,nslope_new 1858 tsurf(:,islope) = tsurf_old_slope(:,1) 1859 qsurf(:,:,islope) = qsurf_old_slope(:,:,1) 1860 emis(:,islope) = emis_old_slope(:,1) 1861 watercap(:,islope) = watercap_old_slope(:,1) 1862 perennial_co2ice(:,islope) = 1863 & perennial_co2_old_slope(:,1) 1864 tsoil(:,:,islope) = tsoil_old_slope(:,:,1) 1865 albedo(:,:,islope) = albedo_old_slope(:,:,1) 1866 inertiesoil(:,:,islope) = inertiesoil_old_slope(:,:,1) 1867 flux_geo(:,islope) = flux_geo_old_slope(:,1) 1868 h2o_ice_depth(:,islope) = h2o_ice_depth_old_slope(:,1) 1869 lag_co2_ice(:,islope) = lag_co2_ice_old_slope(:,1) 1870 d_coef(:,islope) = d_coef_old_slope(:,1) 1893 1871 enddo 1894 1872 else 1895 write(*,*)' Problem choice of nslope' 1896 write(*,*)' Value not taken into account' 1897 CALL ABORT 1873 do islope = 1,nslope_new 1874 tsurf(:,islope) = tsurf_old_slope(:,iflat) 1875 qsurf(:,:,islope) = qsurf_old_slope(:,:,iflat) 1876 emis(:,islope) = emis_old_slope(:,iflat) 1877 watercap(:,islope) = watercap_old_slope(:,iflat) 1878 perennial_co2ice(:,islope) = 1879 & perennial_co2_old_slope(:,iflat) 1880 tsoil(:,:,islope) = tsoil_old_slope(:,:,iflat) 1881 albedo(:,:,islope) = albedo_old_slope(:,:,iflat) 1882 inertiesoil(:,:,islope) = inertiesoil_old_slope(:,:,iflat) 1883 flux_geo(:,islope) = flux_geo_old_slope(:,iflat) 1884 h2o_ice_depth(:,islope) = h2o_ice_depth_old_slope(:,iflat) 1885 lag_co2_ice(:,islope) = lag_co2_ice_old_slope(:,iflat) 1886 d_coef(:,islope) = d_coef_old_slope(:,iflat) 1887 enddo 1898 1888 endif 1889 1890 deallocate(default_def_slope,tsurf_old_slope,qsurf_old_slope) 1891 deallocate(emis_old_slope,watercap_old_slope) 1892 deallocate(perennial_co2_old_slope,tsoil_old_slope) 1893 deallocate(inertiesoil_old_slope,flux_geo_old_slope) 1894 deallocate(albedo_old_slope,h2o_ice_depth_old_slope) 1895 deallocate(lag_co2_ice_old_slope,d_coef_old_slope) 1899 1896 1900 1897 endif !nslope=nslope_new … … 1902 1899 else 1903 1900 write(*,*) ' Unknown (misspelled?) option!!!' 1904 end if ! of if (trim(modif) .eq.'...') elseif ...1901 end if ! of if (trim(modif) == '...') elseif ... 1905 1902 1906 1903 enddo ! of do ! infinite loop on liste of changes -
trunk/LMDZ.MARS/libf/phymars/paleoclimate_mod.F90
r3333 r3336 15 15 16 16 !$OMP THREADPRIVATE(paleoclimate) 17 real, save, allocatable, dimension(:,:) :: h2o_ice_depth 18 real, save, allocatable, dimension(:,:) :: lag_co2_ice 19 real, save, allocatable, dimension(:,:) :: d_coef ! Diffusion coeficent20 real, save :: albedo_perennialco2 21 logical, save :: lag_layer 22 logical, save :: include_waterbuoyancy 17 real, save, allocatable, dimension(:,:) :: h2o_ice_depth ! Thickness of the lag before H2O ice [m] 18 real, save, allocatable, dimension(:,:) :: lag_co2_ice ! Thickness of the lag before CO2 ice [m] 19 real, save, allocatable, dimension(:,:) :: d_coef ! Diffusion coefficent 20 real, save :: albedo_perennialco2 ! Albedo for perennial co2 ice [1] 21 logical, save :: lag_layer ! Does lag layer is present? 22 logical, save :: include_waterbuoyancy ! Include the effect of water buoyancy when computing the sublimation of water ice ? 23 23 !$OMP THREADPRIVATE(h2o_ice_depth,lag_co2_ice,d_coef,albedo_perennialco2,lag_layer,include_waterbuoyancy) 24 24
Note: See TracChangeset
for help on using the changeset viewer.