[38] | 1 | subroutine albedocaps(zls,ngrid,piceco2,psolaralb,emisref) |
---|
| 2 | |
---|
| 3 | ! routine which changes the albedo (and emissivity) of the surface |
---|
| 4 | ! depending on the presence of CO2 ice on the surface |
---|
| 5 | |
---|
| 6 | ! to use the 'getin' routine |
---|
[1047] | 7 | use ioipsl_getincom, only: getin |
---|
[1543] | 8 | use geometry_mod, only: latitude ! grid point latitudes (rad) |
---|
[1047] | 9 | use surfdat_h, only: TESicealbedo, TESice_Ncoef, TESice_Scoef, & |
---|
| 10 | emisice, albedice, watercaptag, albedo_h2o_ice, & |
---|
| 11 | emissiv, albedodat |
---|
[38] | 12 | implicit none |
---|
| 13 | |
---|
[1528] | 14 | include"callkeys.h" |
---|
[38] | 15 | |
---|
| 16 | ! arguments: |
---|
| 17 | real,intent(in) :: zls ! solar longitude (rad) |
---|
| 18 | integer,intent(in) :: ngrid |
---|
| 19 | real,intent(in) :: piceco2(ngrid) ! amount of CO2 ice on the surface (kg/m2) |
---|
| 20 | real,intent(out) :: psolaralb(ngrid,2) ! albedo of the surface |
---|
| 21 | real,intent(out) :: emisref(ngrid) ! emissivity of the surface |
---|
| 22 | |
---|
| 23 | |
---|
| 24 | ! local variables: |
---|
| 25 | logical,save :: firstcall=.true. |
---|
| 26 | integer :: ig,icap |
---|
| 27 | |
---|
| 28 | ! 1. Initializations |
---|
[1779] | 29 | ! AS: OK firstcall absolute |
---|
[38] | 30 | if (firstcall) then |
---|
| 31 | ! find out if user wants to use TES cap albedoes or not |
---|
| 32 | TESicealbedo=.false. ! default value |
---|
| 33 | write(*,*)" albedocaps: Use TES Cap albedoes ?" |
---|
| 34 | call getin("TESicealbedo",TESicealbedo) |
---|
| 35 | write(*,*)" albedocaps: TESicealbedo = ",TESicealbedo |
---|
| 36 | |
---|
| 37 | ! if using TES albedoes, load coeffcients |
---|
| 38 | if (TESicealbedo) then |
---|
| 39 | write(*,*)" albedocaps: Coefficient for Northern Cap ?" |
---|
| 40 | TESice_Ncoef=1.0 ! default value |
---|
| 41 | call getin("TESice_Ncoef",TESice_Ncoef) |
---|
| 42 | write(*,*)" albedocaps: TESice_Ncoef = ",TESice_Ncoef |
---|
| 43 | |
---|
| 44 | write(*,*)" albedocaps: Coefficient for Southern Cap ?" |
---|
| 45 | TESice_Scoef=1.0 ! default value |
---|
| 46 | call getin("TESice_Scoef",TESice_Scoef) |
---|
| 47 | write(*,*)" albedocaps: TESice_Scoef = ",TESice_Scoef |
---|
| 48 | endif |
---|
| 49 | |
---|
| 50 | firstcall=.false. |
---|
| 51 | endif ! of if (firstcall) |
---|
| 52 | |
---|
| 53 | do ig=1,ngrid |
---|
[1541] | 54 | if (latitude(ig).lt.0.) then |
---|
[38] | 55 | icap=2 ! Southern hemisphere |
---|
| 56 | else |
---|
| 57 | icap=1 ! Northern hemisphere |
---|
| 58 | endif |
---|
| 59 | |
---|
| 60 | if (piceco2(ig).gt.0) then |
---|
| 61 | ! set emissivity of surface to be the ice emissivity |
---|
| 62 | emisref(ig)=emisice(icap) |
---|
| 63 | ! set the surface albedo to be the ice albedo |
---|
| 64 | if (TESicealbedo) then |
---|
[801] | 65 | call TES_icecap_albedo(zls,ig,psolaralb(ig,1),icap) |
---|
[38] | 66 | psolaralb(ig,2)=psolaralb(ig,1) |
---|
| 67 | else |
---|
| 68 | psolaralb(ig,1)=albedice(icap) |
---|
| 69 | psolaralb(ig,2)=albedice(icap) |
---|
| 70 | endif |
---|
[283] | 71 | else if (watercaptag(ig) .and. water) then |
---|
| 72 | ! there is a water ice cap: set the surface albedo to the water ice one |
---|
| 73 | ! to do : emissivity |
---|
| 74 | emisref(ig) = 1 |
---|
| 75 | psolaralb(ig,1)=albedo_h2o_ice |
---|
| 76 | psolaralb(ig,2)=albedo_h2o_ice |
---|
[38] | 77 | else |
---|
| 78 | ! set emissivity of surface to be bare ground emissivity |
---|
| 79 | emisref(ig)=emissiv |
---|
| 80 | ! set the surface albedo to bare ground albedo |
---|
| 81 | psolaralb(ig,1)=albedodat(ig) |
---|
| 82 | psolaralb(ig,2)=albedodat(ig) |
---|
| 83 | endif ! of if (piceco2(ig).gt.0) |
---|
| 84 | enddo ! of ig=1,ngrid |
---|
| 85 | end subroutine albedocaps |
---|
| 86 | |
---|
| 87 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[801] | 88 | subroutine TES_icecap_albedo(zls,ig,alb,icap) |
---|
[38] | 89 | |
---|
[1543] | 90 | use geometry_mod, only: latitude, longitude ! in radians |
---|
[1047] | 91 | use surfdat_h, only: albedice, TESice_Ncoef, TESice_Scoef |
---|
[1130] | 92 | use netcdf, only: nf90_open, NF90_NOWRITE, NF90_NOERR, & |
---|
| 93 | nf90_strerror, nf90_inq_varid, nf90_get_var, nf90_close |
---|
| 94 | |
---|
[38] | 95 | implicit none |
---|
[1528] | 96 | include"datafile.h" |
---|
[38] | 97 | |
---|
| 98 | ! arguments: |
---|
| 99 | real,intent(in) :: zls ! solar longitude (rad) |
---|
| 100 | integer,intent(in) :: ig ! grid point index |
---|
| 101 | real,intent(out) :: alb ! (interpolated) TES ice albedo at that grid point |
---|
[801] | 102 | integer :: icap ! =1: Northern hemisphere =2: Southern hemisphere |
---|
[38] | 103 | |
---|
| 104 | ! local variables: |
---|
| 105 | logical,save :: firstcall=.true. |
---|
| 106 | real,save :: zls_old ! value of zls from a previous call |
---|
| 107 | integer,save :: tinf,tsup ! encompassing time indexes of TES data |
---|
| 108 | real,save :: reltime ! relative position in-between time indexes (in [0;1]) |
---|
| 109 | integer :: latinf,latsup ! encompassing latitude indexes of TES data |
---|
| 110 | real :: rellat ! relative position in-between latitude indexes (in[0;1]) |
---|
| 111 | integer :: loninf,lonsup ! encompassing longitude indexes of TES data |
---|
| 112 | real :: rellon !relative position in-between longitude indexes (in[0;1]) |
---|
| 113 | real,save :: pi,radeg ! to convert radians to degrees |
---|
| 114 | real :: zlsd ! solar longitude, in degrees |
---|
| 115 | real :: latd ! latitude, in degrees |
---|
| 116 | real :: lond ! longitude, in degrees |
---|
| 117 | integer :: i |
---|
| 118 | |
---|
| 119 | ! TES datasets: (hard coded fixed length/sizes; for now) |
---|
| 120 | integer,parameter :: TESlonsize=72 |
---|
| 121 | real,parameter :: TESdeltalon=5.0 ! step in longitude in TES files |
---|
| 122 | ! longitudes, in TES files, in degrees, from TESlon(1)=-177.5 to TESlon(72)=177.5 |
---|
| 123 | real,save :: TESlon(TESlonsize) |
---|
| 124 | integer,parameter :: TESlatsize=30 |
---|
| 125 | real,parameter :: TESdeltalat=2.0 ! step in latitude in TES files |
---|
| 126 | ! latitudes (north hemisphere file), in degrees, from TESlatn(1)=31, |
---|
| 127 | ! to TESlatn(30)=89 ; TESlatn(8)=45 |
---|
| 128 | real,parameter :: TESlatnmin=45. ! minimum TES latitude (North hemisphere) |
---|
| 129 | real,parameter :: TESlatsmax=-45. ! maximum TES latitude (South hemisphere) |
---|
| 130 | real,save :: TESlatn(TESlatsize) |
---|
| 131 | ! latitudes (south hemisphere file), in degrees, from TESlats(1)=-89, |
---|
| 132 | ! to TESlats(30)=-31 ; TESlats(23)=-45 |
---|
| 133 | real,save :: TESlats(TESlatsize) |
---|
| 134 | integer,parameter :: TESlssize=72 |
---|
| 135 | real,parameter :: TESdeltals=5.0 ! step in solar longitude in TES files |
---|
| 136 | ! Solar longitude in TES files, TESls(1)=2.5 to TESls(72)=357.5 |
---|
| 137 | real,save :: TESls(TESlssize) |
---|
| 138 | ! TES North albedo (=-1 for missing values) |
---|
| 139 | real,save :: TESalbn(TESlonsize,TESlatsize,TESlssize) |
---|
| 140 | ! TES South albedo (=-1 for missing values) |
---|
| 141 | real,save :: TESalbs(TESlonsize,TESlatsize,TESlssize) |
---|
| 142 | ! encompassing nodes arranged as follow : 4 3 |
---|
| 143 | real :: val(4) ! 1 2 |
---|
| 144 | |
---|
| 145 | !NetCDF variables: |
---|
| 146 | integer :: ierr ! NetCDF status |
---|
| 147 | integer :: nid ! NetCDF file ID |
---|
| 148 | integer :: nvarid ! NetCDF variable ID |
---|
| 149 | |
---|
| 150 | ! 0. Preliminary stuff |
---|
| 151 | if (firstcall) then |
---|
| 152 | ! Load TES albedoes for Northern Hemisphere |
---|
| 153 | ! Note: datafile() is defined in "datafile.h" |
---|
[1130] | 154 | ierr=nf90_open(trim(datafile)//"/npsc_albedo.nc",NF90_NOWRITE,nid) |
---|
| 155 | IF (ierr.NE.NF90_NOERR) THEN |
---|
[38] | 156 | write(*,*)'Problem opening npsc_albedo.nc (phymars/albedocaps.F90)' |
---|
| 157 | write(*,*)'It should be in :',trim(datafile),'/' |
---|
[707] | 158 | write(*,*)'1) You can change this directory address in callfis.def with' |
---|
| 159 | write(*,*)' datadir=/path/to/datafiles' |
---|
[38] | 160 | write(*,*)'2) If necessary, npsc_albedo.nc (and other datafiles)' |
---|
| 161 | write(*,*)' can be obtained online on:' |
---|
[1381] | 162 | write(*,*)' http://www.lmd.jussieu.fr/~lmdz/planets/mars/datadir' |
---|
[38] | 163 | CALL ABORT |
---|
[1130] | 164 | ELSE |
---|
| 165 | write(*,*) "albedocaps: using file ",trim(datafile)//"/npsc_albedo.nc" |
---|
[38] | 166 | ENDIF |
---|
| 167 | |
---|
[1130] | 168 | ierr=nf90_inq_varid(nid,"longitude",nvarid) |
---|
| 169 | if (ierr.ne.NF90_NOERR) then |
---|
[38] | 170 | write(*,*) "Failed to find longitude in file!" |
---|
[1130] | 171 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 172 | stop |
---|
[38] | 173 | else |
---|
[1130] | 174 | ierr=nf90_get_var(nid,nvarid,TESlon) |
---|
| 175 | if (ierr.ne.NF90_NOERR) then |
---|
| 176 | write(*,*) "Failed loading longitude data from file!" |
---|
| 177 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 178 | stop |
---|
| 179 | endif |
---|
[38] | 180 | endif |
---|
| 181 | |
---|
[1130] | 182 | ierr=nf90_inq_varid(nid,"latitude",nvarid) |
---|
| 183 | if (ierr.ne.NF90_NOERR) then |
---|
[38] | 184 | write(*,*) "Failed to find latitude in file!" |
---|
[1130] | 185 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 186 | stop |
---|
[38] | 187 | else |
---|
[1130] | 188 | ierr=nf90_get_var(nid,nvarid,TESlatn) |
---|
| 189 | if (ierr.ne.NF90_NOERR) then |
---|
| 190 | write(*,*) "Failed loading latitude data from file!" |
---|
| 191 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 192 | stop |
---|
| 193 | endif |
---|
[38] | 194 | endif |
---|
| 195 | |
---|
[1130] | 196 | ierr=nf90_inq_varid(nid,"time",nvarid) |
---|
| 197 | if (ierr.ne.NF90_NOERR) then |
---|
[38] | 198 | write(*,*) "Failed to find time in file!" |
---|
[1130] | 199 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 200 | stop |
---|
[38] | 201 | else |
---|
[1130] | 202 | ierr=nf90_get_var(nid,nvarid,TESls) |
---|
| 203 | if (ierr.ne.NF90_NOERR) then |
---|
| 204 | write(*,*) "Failed loading time data from file!" |
---|
| 205 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 206 | stop |
---|
| 207 | endif |
---|
[38] | 208 | endif |
---|
| 209 | |
---|
[1130] | 210 | ierr=nf90_inq_varid(nid,"albedo",nvarid) |
---|
| 211 | if (ierr.ne.NF90_NOERR) then |
---|
[38] | 212 | write(*,*) "Failed to find albedo in file!" |
---|
[1130] | 213 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 214 | stop |
---|
[38] | 215 | else |
---|
[1130] | 216 | ierr=nf90_get_var(nid,nvarid,TESalbn) |
---|
| 217 | if (ierr.ne.NF90_NOERR) then |
---|
| 218 | write(*,*) "Failed loading albedo data from file!" |
---|
| 219 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 220 | stop |
---|
| 221 | endif |
---|
[38] | 222 | endif |
---|
| 223 | |
---|
[1130] | 224 | ierr=nf90_close(nid) |
---|
| 225 | |
---|
[38] | 226 | ! Load albedoes for Southern Hemisphere |
---|
[1130] | 227 | ierr=nf90_open(trim(datafile)//"/spsc_albedo.nc",NF90_NOWRITE,nid) |
---|
| 228 | IF (ierr.NE.NF90_NOERR) THEN |
---|
[38] | 229 | write(*,*)'Problem opening spsc_albedo.nc (phymars/albedocaps.F90)' |
---|
| 230 | write(*,*)'It should be in :',trim(datafile),'/' |
---|
[707] | 231 | write(*,*)'1) You can change this directory address in callfis.def with' |
---|
| 232 | write(*,*)' datadir=/path/to/datafiles' |
---|
[38] | 233 | write(*,*)'2) If necessary, spsc_albedo.nc (and other datafiles)' |
---|
| 234 | write(*,*)' can be obtained online on:' |
---|
[1381] | 235 | write(*,*)' http://www.lmd.jussieu.fr/~lmdz/planets/mars/datadir' |
---|
[38] | 236 | CALL ABORT |
---|
[1130] | 237 | ELSE |
---|
| 238 | write(*,*) "albedocaps: using file ",trim(datafile)//"/spsc_albedo.nc" |
---|
[38] | 239 | ENDIF |
---|
| 240 | |
---|
[1130] | 241 | ierr=nf90_inq_varid(nid,"latitude",nvarid) |
---|
| 242 | if (ierr.ne.NF90_NOERR) then |
---|
[38] | 243 | write(*,*) "Failed to find latitude in file!" |
---|
[1130] | 244 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 245 | stop |
---|
[38] | 246 | else |
---|
[1130] | 247 | ierr=nf90_get_var(nid,nvarid,TESlats) |
---|
| 248 | if (ierr.ne.NF90_NOERR) then |
---|
| 249 | write(*,*) "Failed loading latitude data from file!" |
---|
| 250 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 251 | stop |
---|
| 252 | endif |
---|
[38] | 253 | endif |
---|
| 254 | |
---|
[1130] | 255 | ierr=nf90_inq_varid(nid,"albedo",nvarid) |
---|
| 256 | if (ierr.ne.NF90_NOERR) then |
---|
[38] | 257 | write(*,*) "Failed to find albedo in file!" |
---|
[1130] | 258 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 259 | stop |
---|
[38] | 260 | else |
---|
[1130] | 261 | ierr=nf90_get_var(nid,nvarid,TESalbs) |
---|
| 262 | if (ierr.ne.NF90_NOERR) then |
---|
| 263 | write(*,*) "Failed loading albedo data from file!" |
---|
| 264 | write(*,*)trim(nf90_strerror(ierr)) |
---|
| 265 | stop |
---|
| 266 | endif |
---|
[38] | 267 | endif |
---|
| 268 | |
---|
[1130] | 269 | ierr=nf90_close(nid) |
---|
| 270 | |
---|
[38] | 271 | ! constants: |
---|
| 272 | pi=acos(-1.) |
---|
| 273 | radeg=180/pi |
---|
| 274 | |
---|
| 275 | zls_old=-999 ! dummy initialization |
---|
| 276 | |
---|
| 277 | firstcall=.false. |
---|
| 278 | endif ! of if firstcall |
---|
| 279 | |
---|
[801] | 280 | ! 1. Identify encompassing latitudes |
---|
[38] | 281 | |
---|
| 282 | ! Check that latitude is such that there is TES data to use |
---|
| 283 | ! (ie: latitude 45 deg and poleward) otherwise use 'default' albedoes |
---|
[1541] | 284 | latd=latitude(ig)*radeg ! latitude, in degrees |
---|
[38] | 285 | if (icap.eq.1) then |
---|
| 286 | ! North hemisphere |
---|
| 287 | if (latd.lt.TESlatnmin) then |
---|
| 288 | alb=albedice(1) |
---|
| 289 | ! the job is done; quit this routine |
---|
| 290 | return |
---|
| 291 | else |
---|
| 292 | ! find encompassing latitudes |
---|
| 293 | if (latd.ge.TESlatn(TESlatsize)) then |
---|
| 294 | latinf=TESlatsize |
---|
| 295 | latsup=TESlatsize |
---|
| 296 | rellat=0. |
---|
| 297 | else |
---|
| 298 | do i=1,TESlatsize-1 |
---|
| 299 | if ((latd.ge.TESlatn(i)).and.(latd.lt.TESlatn(i+1))) then |
---|
| 300 | latinf=i |
---|
| 301 | latsup=i+1 |
---|
| 302 | rellat=(latd-TESlatn(i))/TESdeltalat |
---|
| 303 | exit ! found encompassing indexes; quit loop |
---|
| 304 | endif |
---|
| 305 | enddo |
---|
| 306 | endif |
---|
| 307 | endif ! of if (latd.lt.TESlatnmin) |
---|
| 308 | else ! icap=2 |
---|
| 309 | ! South hemisphere |
---|
| 310 | if (latd.gt.TESlatsmax) then |
---|
| 311 | alb=albedice(2) |
---|
| 312 | ! the job is done; quit this routine |
---|
| 313 | return |
---|
| 314 | else |
---|
| 315 | ! find encompassing latitudes |
---|
| 316 | if (latd.lt.TESlats(1)) then |
---|
| 317 | latinf=1 |
---|
| 318 | latsup=1 |
---|
| 319 | rellat=0. |
---|
| 320 | else |
---|
| 321 | do i=1,TESlatsize-1 |
---|
| 322 | if ((latd.ge.TESlats(i)).and.(latd.lt.TESlats(i+1))) then |
---|
| 323 | latinf=i |
---|
| 324 | latsup=i+1 |
---|
| 325 | rellat=(latd-TESlats(i))/TESdeltalat |
---|
| 326 | exit ! found encompassing indexes; quit loop |
---|
| 327 | endif |
---|
| 328 | enddo |
---|
| 329 | endif |
---|
| 330 | endif ! of if (latd.gt.-45.) |
---|
| 331 | endif ! of if (icap.eq.1) |
---|
| 332 | |
---|
| 333 | ! 2. Identify encompassing time indexes |
---|
| 334 | if (zls.ne.zls_old) then |
---|
| 335 | zlsd=zls*radeg ! solar longitude, in degrees |
---|
| 336 | |
---|
| 337 | if (zlsd.lt.TESls(1)) then |
---|
| 338 | tinf=TESlssize |
---|
| 339 | tsup=1 |
---|
| 340 | reltime=0.5+zlsd/TESdeltals |
---|
| 341 | else |
---|
| 342 | if (zlsd.ge.TESls(TESlssize)) then |
---|
| 343 | tinf=TESlssize |
---|
| 344 | tsup=1 |
---|
| 345 | reltime=(360.-zlsd)/TESdeltals |
---|
| 346 | else |
---|
| 347 | ! look for encompassing indexes |
---|
| 348 | do i=1,TESlssize-1 |
---|
| 349 | if ((zlsd.ge.TESls(i)).and.(zlsd.lt.TESls(i+1))) then |
---|
| 350 | tinf=i |
---|
| 351 | tsup=i+1 |
---|
| 352 | reltime=(zlsd-TESls(i))/TESdeltals |
---|
| 353 | exit ! quit loop, we found the indexes |
---|
| 354 | endif |
---|
| 355 | enddo |
---|
| 356 | endif |
---|
| 357 | endif ! of if (zlsd.lt.TESls(1)) |
---|
| 358 | |
---|
| 359 | zls_old=zls ! store current zls |
---|
| 360 | endif ! of if (zls.ne.zls_old) |
---|
| 361 | |
---|
| 362 | ! 3. Identify encompassing longitudes |
---|
[1541] | 363 | lond=longitude(ig)*radeg ! east longitude, in degrees |
---|
[38] | 364 | if (lond.lt.TESlon(1)) then |
---|
| 365 | loninf=TESlonsize |
---|
| 366 | lonsup=1 |
---|
| 367 | rellon=0.5+(180.+lond)/TESdeltalon |
---|
| 368 | else |
---|
| 369 | if (lond.ge.TESlon(TESlonsize)) then |
---|
| 370 | loninf=TESlonsize |
---|
| 371 | lonsup=1 |
---|
| 372 | rellon=(180-lond)/TESdeltalon |
---|
| 373 | else |
---|
| 374 | do i=1,TESlonsize-1 |
---|
| 375 | if ((lond.ge.TESlon(i)).and.(lond.lt.TESlon(i+1))) then |
---|
| 376 | loninf=i |
---|
| 377 | lonsup=i+1 |
---|
| 378 | rellon=(lond-TESlon(i))/TESdeltalon |
---|
| 379 | exit ! quit loop, we found the indexes |
---|
| 380 | endif |
---|
| 381 | enddo |
---|
| 382 | endif ! of if (lond.ge.TESlon(TESlonsize)) |
---|
| 383 | endif ! of if (lond.lt.TESlon(1)) |
---|
| 384 | |
---|
| 385 | ! 4. Use linear interpolation in time to build encompassing nodal values |
---|
| 386 | ! encompassing nodes are arranged as follow : 4 3 |
---|
| 387 | ! 1 2 |
---|
| 388 | if (icap.eq.1) then |
---|
| 389 | ! Northern hemisphere |
---|
| 390 | val(1)=(1.-reltime)*TESalbn(loninf,latinf,tinf) & |
---|
| 391 | +reltime*TESalbn(loninf,latinf,tsup) |
---|
| 392 | val(2)=(1.-reltime)*TESalbn(lonsup,latinf,tinf) & |
---|
| 393 | +reltime*TESalbn(lonsup,latinf,tsup) |
---|
| 394 | val(3)=(1.-reltime)*TESalbn(lonsup,latsup,tinf) & |
---|
| 395 | +reltime*TESalbn(lonsup,latsup,tsup) |
---|
| 396 | val(4)=(1.-reltime)*TESalbn(loninf,latsup,tinf) & |
---|
| 397 | +reltime*TESalbn(loninf,latsup,tsup) |
---|
| 398 | else |
---|
| 399 | ! Southern hemisphere |
---|
| 400 | val(1)=(1.-reltime)*TESalbs(loninf,latinf,tinf) & |
---|
| 401 | +reltime*TESalbs(loninf,latinf,tsup) |
---|
| 402 | val(2)=(1.-reltime)*TESalbs(lonsup,latinf,tinf) & |
---|
| 403 | +reltime*TESalbs(lonsup,latinf,tsup) |
---|
| 404 | val(3)=(1.-reltime)*TESalbs(lonsup,latsup,tinf) & |
---|
| 405 | +reltime*TESalbs(lonsup,latsup,tsup) |
---|
| 406 | val(4)=(1.-reltime)*TESalbs(loninf,latsup,tinf) & |
---|
| 407 | +reltime*TESalbs(loninf,latsup,tsup) |
---|
| 408 | endif ! of if (icap.eq.1) |
---|
| 409 | |
---|
| 410 | ! 5. Use bilinear interpolation to compute albedo |
---|
| 411 | alb=(1.-rellon)*(1.-rellat)*val(1) & |
---|
| 412 | +rellon*(1.-rellat)*val(2) & |
---|
| 413 | +rellon*rellat*val(3) & |
---|
| 414 | +(1.-rellon)*rellat*val(4) |
---|
| 415 | |
---|
| 416 | ! 6. Apply coefficient to interpolated TES albedo |
---|
| 417 | if (icap.eq.1) then |
---|
| 418 | alb=alb*TESice_Ncoef |
---|
| 419 | else |
---|
| 420 | alb=alb*TESice_Scoef |
---|
| 421 | endif ! of if (icap.eq.1) |
---|
| 422 | |
---|
[707] | 423 | ! Make sure that returned albedo is never greater than 0.90 |
---|
| 424 | if (alb.gt.0.90) alb=0.90 |
---|
| 425 | |
---|
[38] | 426 | end subroutine TES_icecap_albedo |
---|
| 427 | |
---|