00001
00002
00003
00004
00005 !> @mainpage
00006 !!
00007 !! @section Description
00008 !!
00009 !! The Mars Atmosphere-Ice Coupler MAIC-2 is a simple, latitudinal model,
00010 !! which consists of a set of parameterisations for the surface temperature,
00011 !! the atmospheric water transport and the surface mass balance (condensation
00012 !! minus evaporation) of water ice. It is driven directly by orbital
00013 !! parameters. A detailed description of the model is given in the publication
00014 !! by Greve et al. (2010).
00015 !!
00016 !! The model equations of MAIC-2 are discretised by a
00017 !! finite-difference/finite-volume scheme.
00018 !! Coding is done in the programming language Fortran 90.
00019 !!
00020 !! Required model forcing (as functions of time):
00021 !! @li Obliquity (axial tilt).
00022 !! @li Orbital eccentricity.
00023 !! @li Solar longitude (Ls) of perihelion.
00024 !!
00025 !! Output (as functions of latitude and time):
00026 !! @li Surface temperature.
00027 !! @li Evaporation rate of water ice.
00028 !! @li Condensation rate of water ice.
00029 !! @li Atmospheric water content.
00030 !! @li Surface mass balance of water ice.
00031 !! @li Ice thickness.\n
00032 !!
00033 !! References:
00034 !! @li Greve, R., B. Grieger and O. J. Stenzel. 2010.\n
00035 !! MAIC-2, a latitudinal model for the Martian surface temperature,
00036 !! atmospheric water transport and surface glaciation.\n
00037 !! Planetary and Space Science 58 (6), 931-940.
00038 !! @li MAIC-2 website: http://maic2.greveweb.net/
00039 !!
00040 !! @section Copyright
00041 !!
00042 !! Copyright 2010, 2011 Ralf Greve, Bjoern Grieger, Oliver J. Stenzel
00043 !!
00044 !! @section License
00045 !!
00046 !! MAIC-2 is free software: you can redistribute it and/or modify
00047 !! it under the terms of the GNU General Public License as published by
00048 !! the Free Software Foundation, either version 3 of the License, or
00049 !! (at your option) any later version.
00050 !!
00051 !! MAIC-2 is distributed in the hope that it will be useful,
00052 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
00053 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00054 !! GNU General Public License for more details.
00055 !!
00056 !! You should have received a copy of the GNU General Public License
00057 !! along with MAIC-2. If not, see <http://www.gnu.org/licenses/>.
00058 !!
00059 !! @file
00060 !!
00061 !! Main program file of MAIC-2.
00062 !!
00063 !! @section Copyright
00064 !!
00065 !! Copyright 2010, 2011 Ralf Greve, Bjoern Grieger, Oliver J. Stenzel
00066 !!
00067 !! @section License
00068 !!
00069 !! This file is part of MAIC-2.
00070 !!
00071 !! MAIC-2 is free software: you can redistribute it and/or modify
00072 !! it under the terms of the GNU General Public License as published by
00073 !! the Free Software Foundation, either version 3 of the License, or
00074 !! (at your option) any later version.
00075 !!
00076 !! MAIC-2 is distributed in the hope that it will be useful,
00077 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
00078 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00079 !! GNU General Public License for more details.
00080 !!
00081 !! You should have received a copy of the GNU General Public License
00082 !! along with MAIC-2. If not, see <http://www.gnu.org/licenses/>.
00083 !<
00084 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00085
00086
00087
00088 #include "maic2_specs.h"
00089
00090
00091
00092 #include "subroutines/maic2_types.F90"
00093 #include "subroutines/maic2_variables.F90"
00094
00095
00096
00097 #include "subroutines/instemp.f90"
00098 #include "subroutines/evaporation.f90"
00099 #include "subroutines/condensation.f90"
00100
00101
00102 !> Main program of MAIC-2.
00103 !<------------------------------------------------------------------------------
00104 program maic2
00105
00106
00107
00108 use maic2_types
00109 use maic2_variables
00110
00111 implicit none
00112 integer(i4b) :: l, n
00113 integer(i4b) :: ios
00114 integer(i4b) :: itercount_max
00115 integer(i4b) :: ndata_insol
00116 real(dp) :: time, time_init, time_end, dtime
00117 real(dp) :: dphi_equi
00118 real(dp) :: d_dummy
00119 character (len=100) :: runname
00120 character :: ch_dummy
00121 logical :: output_flag
00122
00123
00124
00125
00126
00127 RHO_I = 9.1e+02_dp
00128
00129
00130 RHO_W = 1.0e+03_dp
00131
00132
00133 G = 3.72_dp
00134
00135
00136 R = 3.396e+06_dp
00137
00138
00139
00140
00141 RHO = RHO_I
00142
00143 rho_inv = 1.0_dp/RHO
00144
00145
00146
00147 runname = RUNNAME
00148
00149
00150
00151 time_init = TIME_INIT0*YEAR_SEC
00152 time_end = TIME_END0*YEAR_SEC
00153 dtime = DTIME0*YEAR_SEC
00154
00155 #if OUTPUT==1
00156 dtime_out = DTIME_OUT0 * YEAR_SEC
00157 #elif OUTPUT==2
00158 n_output = N_OUTPUT
00159 time_output( 1) = TIME_OUT0_01 * YEAR_SEC
00160 time_output( 2) = TIME_OUT0_02 * YEAR_SEC
00161 time_output( 3) = TIME_OUT0_03 * YEAR_SEC
00162 time_output( 4) = TIME_OUT0_04 * YEAR_SEC
00163 time_output( 5) = TIME_OUT0_05 * YEAR_SEC
00164 time_output( 6) = TIME_OUT0_06 * YEAR_SEC
00165 time_output( 7) = TIME_OUT0_07 * YEAR_SEC
00166 time_output( 8) = TIME_OUT0_08 * YEAR_SEC
00167 time_output( 9) = TIME_OUT0_09 * YEAR_SEC
00168 time_output(10) = TIME_OUT0_10 * YEAR_SEC
00169 time_output(11) = TIME_OUT0_11 * YEAR_SEC
00170 time_output(12) = TIME_OUT0_12 * YEAR_SEC
00171 time_output(13) = TIME_OUT0_13 * YEAR_SEC
00172 time_output(14) = TIME_OUT0_14 * YEAR_SEC
00173 time_output(15) = TIME_OUT0_15 * YEAR_SEC
00174 time_output(16) = TIME_OUT0_16 * YEAR_SEC
00175 time_output(17) = TIME_OUT0_17 * YEAR_SEC
00176 time_output(18) = TIME_OUT0_18 * YEAR_SEC
00177 time_output(19) = TIME_OUT0_19 * YEAR_SEC
00178 time_output(20) = TIME_OUT0_20 * YEAR_SEC
00179 #endif
00180
00181
00182
00183 insol_ma_90 = 0.0_dp
00184 obl_data = 0.0_dp
00185 ecc_data = 0.0_dp
00186 ave_data = 0.0_dp
00187 cp_data = 0.0_dp
00188
00189 open(21, iostat=ios, &
00190 file=INPATH//'/'//INSOL_MA_90N_FILE, &
00191 status='old')
00192 if (ios /= 0) stop ' Error when opening the data file for orbital parameters!'
00193
00194 read(21,*) ch_dummy, insol_time_min, insol_time_stp, insol_time_max
00195
00196 if (ch_dummy /= '#') then
00197 write(6,*) 'insol_time_min, insol_time_stp, insol_time_max not defined in'
00198 write(6,*) 'data file!'
00199 end if
00200
00201 ndata_insol = (insol_time_max-insol_time_min)/insol_time_stp
00202
00203 if (ndata_insol > 100000) &
00204 stop 'Too many data in orbital-parameter-data file!'
00205
00206 do n=0, ndata_insol
00207 read(21,*) d_dummy, ecc_data(n), obl_data(n), cp_data(n), ave_data(n), insol_ma_90(n)
00208 obl_data(n) = obl_data(n) *pi_180
00209 ave_data(n) = ave_data(n) *pi_180
00210 end do
00211
00212 close(21, status='keep')
00213
00214
00215
00216
00217
00218 dphi_equi = 180.0_dp/LMAX *pi_180
00219
00220 do l=0, LMAX
00221 phi_node(l) = -90.0_dp*pi_180 + dble(l)*dphi_equi
00222
00223
00224
00225 end do
00226
00227
00228
00229 do l=1, LMAX
00230 dphi(l) = phi_node(l) - phi_node(l-1)
00231 dphi_inv(l) = 1.0_dp/dphi(l)
00232 end do
00233
00234
00235
00236 phi_cb1(0) = phi_node(0)
00237 do l=1, LMAX
00238 phi_cb1(l) = 0.5_dp*(phi_node(l-1)+phi_node(l))
00239 end do
00240
00241 cos_phi_cb1 = cos(phi_cb1)
00242 sin_phi_cb1 = sin(phi_cb1)
00243
00244
00245
00246 do l=0, LMAX-1
00247 phi_cb2(l) = 0.5_dp*(phi_node(l)+phi_node(l+1))
00248 end do
00249 phi_cb2(LMAX) = phi_node(LMAX)
00250
00251 cos_phi_cb2 = cos(phi_cb2)
00252 sin_phi_cb2 = sin(phi_cb2)
00253
00254
00255
00256 do l=0, LMAX
00257 diff_aux(l) = DIFF_WATER_MAIC/(R**2*(sin_phi_cb2(l)-sin_phi_cb1(l)))
00258 end do
00259
00260
00261
00262 #if H_INIT==1
00263
00264 H = THICK_INIT
00265
00266 #elif H_INIT==2
00267
00268 do l=0, LMAX
00269 H(l) = 3000.0_dp &
00270 * ( 1.0_dp-(90.0_dp*pi_180-abs(phi_node(l)))**2/(10.0_dp*pi_180)**2 )
00271 H(l) = max(H(l), -0.1_dp)
00272 end do
00273
00274 #endif
00275
00276 water = WATER_INIT
00277
00278
00279
00280 #if OUTPUT==1
00281 iter_out = nint(dtime_out/dtime)
00282 #elif OUTPUT==2
00283 do n=1, n_output
00284 iter_output(n) = nint((time_output(n)-time_init)/dtime)
00285 end do
00286 #endif
00287
00288 open(12, iostat=ios, &
00289 file=OUTPATH//'/'//trim(runname)//'.out', &
00290 status='replace')
00291 if (ios /= 0) stop ' Error when opening the output file runname.out!'
00292
00293
00294
00295
00296
00297 write(6,*) ' '
00298
00299 itercount=1; write(6,'(i10)') itercount
00300
00301 itercount_max = nint((time_end-time_init)/dtime)
00302
00303 main_loop : do itercount=1, itercount_max
00304
00305 if ( mod(itercount, 1000) == 0 ) &
00306 write(6,'(i10)') itercount
00307
00308
00309
00310 time = time_init + real(itercount,dp)*dtime
00311
00312
00313
00314 call boundary_maic2(time, dtime)
00315
00316
00317
00318 call calc_top_maic2(time, dtime)
00319
00320 H = H_new
00321
00322
00323
00324 output_flag = .false.
00325
00326 #if OUTPUT == 1
00327
00328 if ( mod(itercount, iter_out) == 0 ) output_flag = .true.
00329
00330 #elif OUTPUT == 2
00331
00332 do n=1, n_output
00333 if (itercount == iter_output(n)) output_flag = .true.
00334 end do
00335
00336 #endif
00337
00338 if ( output_flag ) call output(time)
00339
00340 end do main_loop
00341
00342
00343
00344 close(12, status='keep')
00345
00346 write(6,'(a)') ' '
00347 write(6,'(a)') ' '
00348 write(6,'(a)') &
00349 ' * * * maic2.F90 r e a d y * * *'
00350 write(6,'(a)') ' '
00351 write(6,'(a)') ' '
00352
00353 end program maic2
00354
00355
00356
00357 #include "subroutines/boundary_maic2.F90"
00358 #include "subroutines/get_orb_par.F90"
00359 #include "subroutines/get_psi_tab.F90"
00360 #include "subroutines/p_sat.f90"
00361 #include "subroutines/diff_trans.F90"
00362 #include "subroutines/tri_sle.F90"
00363 #include "subroutines/calc_top_maic2.F90"
00364 #include "subroutines/output.F90"
00365
00366
00367
00368
00369