4 subroutine iniaqua(nlon,latfi,lonfi,iflag_phys)
29 #include "dimensions.h"
35 #include "indicesol.h"
40 real,
intent(in) :: lonfi(nlon),latfi(nlon)
42 INTEGER type_profil,type_aqua
45 REAL :: run_off_lic_0(nlon)
46 REAL :: qsolsrf(nlon,nbsrf),snsrf(nlon,nbsrf)
47 REAL :: frugs(nlon,nbsrf)
48 REAL :: agesno(nlon,nbsrf)
49 REAL :: tsoil(nlon,nsoilmx,nbsrf)
50 REAL :: tslab(nlon), seaice(nlon)
51 REAL evap(nlon,nbsrf),fder(nlon)
66 real qsol_f,
qsol(nlon)
74 CHARACTER*80 ans,
file_forctl, file_fordat, file_start
75 character*100 file,
var
78 REAL phy_nat(nlon,360)
79 REAL phy_alb(nlon,360)
80 REAL phy_sst(nlon,360)
81 REAL phy_bil(nlon,360)
82 REAL phy_rug(nlon,360)
83 REAL phy_ice(nlon,360)
84 REAL phy_fter(nlon,360)
85 REAL phy_foce(nlon,360)
86 REAL phy_fsic(nlon,360)
87 REAL phy_flic(nlon,360)
89 integer,
save:: read_climoz=0
92 integer :: nbapp_rad_omp
93 real :: co2_ppm_omp,solaire_omp
94 logical :: alb_ocean_omp
101 real falbe(nlon,nbsrf),falblw(nlon,nbsrf)
111 REAL clesphy0( longcles )
120 REAL longitude,latitude
123 DATA latitude,longitude/48.,0./
136 print*,
'iniaqua:type_aqua, type_profil',type_aqua, type_profil
138 if (klon.ne.nlon)
then
139 write(*,*)
"iniaqua: klon=",klon,
" nlon=",nlon
140 stop
'probleme de dimensions dans iniaqua'
168 CALL
getin(
'nbapp_rad',nbapp_rad_omp)
180 CALL
getin(
'co2_ppm',co2_ppm_omp)
182 CALL
getin(
'solaire',solaire_omp)
185 CALL
getin(
'alb_ocean',alb_ocean_omp)
190 alb_ocean=alb_ocean_omp
215 if (type_aqua==1)
then
219 else if (type_aqua==2)
then
227 CALL
getin(
'rugos',rugos_omp)
231 zmasq(:)=pctsrf(:,is_oce)
252 phy_fter(:,
i) = pctsrf(:,is_ter)
253 phy_foce(:,
i) = pctsrf(:,is_oce)
254 phy_fsic(:,
i) = pctsrf(:,is_sic)
255 phy_flic(:,
i) = pctsrf(:,is_lic)
261 s(klon,phy_nat,phy_alb,phy_sst,phy_bil,phy_rug,phy_ice,
262 s phy_fter,phy_foce,phy_flic,phy_fsic)
295 ftsol(
i,:)=phy_sst(
i,1)
296 tsoil(
i,:,:)=phy_sst(
i,1)
297 tslab(
i)=phy_sst(
i,1)
334 . evap, frugs, agesno, tsoil)
336 print*,
'iniaqua: before phyredem'
357 print*,
'iniaqua: after phyredem'
366 SUBROUTINE zenang_an(cycle_diurne,gmtime,rlat,rlon,rmu0,fract)
404 real rlat(klon),
rlon(klon), rmu0(klon), fract(klon)
407 real gmtime1, gmtime2
411 real rmu0m(klon),rmu0a(klon)
414 pi_local = 4.0 * atan(1.0)
423 IF (abs(
rlat(
i)).LE.28.75)
THEN
424 rmu0m(
i)=(210.1924+206.6059*cos(0.0174533*
rlat(
i))**2)/1365.
425 ELSEIF (abs(
rlat(
i)).LE.43.75)
THEN
426 rmu0m(
i)=(187.4562+236.1853*cos(0.0174533*
rlat(
i))**2)/1365.
427 ELSEIF (abs(
rlat(
i)).LE.71.25)
THEN
428 rmu0m(
i)=(162.4439+284.1192*cos(0.0174533*
rlat(
i))**2)/1365.
430 rmu0m(
i)=(172.8125+183.7673*cos(0.0174533*
rlat(
i))**2)/1365.
444 rmu0a(
i)=2.*rmu0m(
i)*sqrt(2.)*pi_local/(4.-pi_local)
445 rmu0(
i)=rmu0a(
i)*abs(sin(pi_local*gmtime+pi_local*
446 &
rlon(
i)/360.))-rmu0a(
i)/sqrt(2.)
450 IF (rmu0(
i).LE.0.)
THEN
482 s(klon,phy_nat,phy_alb,phy_sst,phy_bil,phy_rug,phy_ice,
483 s phy_fter,phy_foce,phy_flic,phy_fsic)
490 #include "netcdf.inc"
492 integer,
intent(in) :: klon
493 real,
intent(in) :: phy_nat(klon,360)
494 real,
intent(in) :: phy_alb(klon,360)
495 real,
intent(in) :: phy_sst(klon,360)
496 real,
intent(in) :: phy_bil(klon,360)
497 real,
intent(in) :: phy_rug(klon,360)
498 real,
intent(in) :: phy_ice(klon,360)
499 real,
intent(in) :: phy_fter(klon,360)
500 real,
intent(in) :: phy_foce(klon,360)
501 real,
intent(in) :: phy_flic(klon,360)
502 real,
intent(in) :: phy_fsic(klon,360)
504 real :: phy_glo(klon_glo,360)
510 INTEGER nid, ndim, ntim
511 INTEGER dims(2), debut(2), epais(2)
513 INTEGER id_nat, id_sst, id_bils, id_rug, id_alb
514 INTEGER id_fter,id_foce,id_fsic,id_flic
516 if (is_mpi_root.and.is_omp_root)
then
518 print*,
'writelim: Ecriture du fichier limit'
520 ierr = nf_create(
"limit.nc", nf_clobber, nid)
522 ierr = nf_put_att_text(nid, nf_global,
"title", 30,
523 .
"Fichier conditions aux limites")
525 ierr = nf_def_dim(nid,
"points_physiques", klon_glo, ndim)
526 ierr = nf_def_dim(nid,
"time", nf_unlimited, ntim)
532 ierr = nf_def_var(nid,
"TEMPS", nf_float, 1,ntim, id_tim)
533 ierr = nf_put_att_text(nid, id_tim,
"title", 17,
534 .
"Jour dans l annee")
536 ierr = nf_def_var(nid,
"NAT", nf_float, 2,dims, id_nat)
537 ierr = nf_put_att_text(nid, id_nat,
"title", 23,
538 .
"Nature du sol (0,1,2,3)")
540 ierr = nf_def_var(nid,
"SST", nf_float, 2,dims, id_sst)
541 ierr = nf_put_att_text(nid, id_sst,
"title", 35,
542 .
"Temperature superficielle de la mer")
544 ierr = nf_def_var(nid,
"BILS", nf_float, 2,dims, id_bils)
545 ierr = nf_put_att_text(nid, id_bils,
"title", 32,
546 .
"Reference flux de chaleur au sol")
548 ierr = nf_def_var(nid,
"ALB", nf_float, 2,dims, id_alb)
549 ierr = nf_put_att_text(nid, id_alb,
"title", 19,
550 .
"Albedo a la surface")
552 ierr = nf_def_var(nid,
"RUG", nf_float, 2,dims, id_rug)
553 ierr = nf_put_att_text(nid, id_rug,
"title", 8,
556 ierr = nf_def_var(nid,
"FTER", nf_float, 2,dims, id_fter)
557 ierr = nf_put_att_text(nid, id_fter,
"title", 8,
"Frac. Terre")
558 ierr = nf_def_var(nid,
"FOCE", nf_float, 2,dims, id_foce)
559 ierr = nf_put_att_text(nid, id_foce,
"title", 8,
"Frac. Terre")
560 ierr = nf_def_var(nid,
"FSIC", nf_float, 2,dims, id_fsic)
561 ierr = nf_put_att_text(nid, id_fsic,
"title", 8,
"Frac. Terre")
562 ierr = nf_def_var(nid,
"FLIC", nf_float, 2,dims, id_flic)
563 ierr = nf_put_att_text(nid, id_flic,
"title", 8,
"Frac. Terre")
565 ierr = nf_enddef(nid)
571 ierr = nf_put_var1_double(nid,id_tim,
k,dble(
k))
573 ierr = nf_put_var1_real(nid,id_tim,
k,float(
k))
581 call
gather(phy_nat,phy_glo)
582 if (is_mpi_root.and.is_omp_root)
then
584 ierr=nf_put_var_double(nid,id_nat,phy_glo)
586 ierr=nf_put_var_real(nid,id_nat,phy_glo)
588 if(ierr.ne.nf_noerr)
then
589 write(*,*)
"writelim error with phy_nat"
590 write(*,*) nf_strerror(ierr)
594 call
gather(phy_sst,phy_glo)
595 if (is_mpi_root.and.is_omp_root)
then
597 ierr=nf_put_var_double(nid,id_sst,phy_glo)
599 ierr=nf_put_var_real(nid,id_sst,phy_glo)
601 if(ierr.ne.nf_noerr)
then
602 write(*,*)
"writelim error with phy_sst"
603 write(*,*) nf_strerror(ierr)
607 call
gather(phy_bil,phy_glo)
608 if (is_mpi_root.and.is_omp_root)
then
610 ierr=nf_put_var_double(nid,id_bils,phy_glo)
612 ierr=nf_put_var_real(nid,id_bils,phy_glo)
614 if(ierr.ne.nf_noerr)
then
615 write(*,*)
"writelim error with phy_bil"
616 write(*,*) nf_strerror(ierr)
620 call
gather(phy_alb,phy_glo)
621 if (is_mpi_root.and.is_omp_root)
then
623 ierr=nf_put_var_double(nid,id_alb,phy_glo)
625 ierr=nf_put_var_real(nid,id_alb,phy_glo)
627 if(ierr.ne.nf_noerr)
then
628 write(*,*)
"writelim error with phy_alb"
629 write(*,*) nf_strerror(ierr)
633 call
gather(phy_rug,phy_glo)
634 if (is_mpi_root.and.is_omp_root)
then
636 ierr=nf_put_var_double(nid,id_rug,phy_glo)
638 ierr=nf_put_var_real(nid,id_rug,phy_glo)
640 if(ierr.ne.nf_noerr)
then
641 write(*,*)
"writelim error with phy_rug"
642 write(*,*) nf_strerror(ierr)
646 call
gather(phy_fter,phy_glo)
647 if (is_mpi_root.and.is_omp_root)
then
649 ierr=nf_put_var_double(nid,id_fter,phy_glo)
651 ierr=nf_put_var_real(nid,id_fter,phy_glo)
653 if(ierr.ne.nf_noerr)
then
654 write(*,*)
"writelim error with phy_fter"
655 write(*,*) nf_strerror(ierr)
659 call
gather(phy_foce,phy_glo)
660 if (is_mpi_root.and.is_omp_root)
then
662 ierr=nf_put_var_double(nid,id_foce,phy_glo)
664 ierr=nf_put_var_real(nid,id_foce,phy_glo)
666 if(ierr.ne.nf_noerr)
then
667 write(*,*)
"writelim error with phy_foce"
668 write(*,*) nf_strerror(ierr)
672 call
gather(phy_fsic,phy_glo)
673 if (is_mpi_root.and.is_omp_root)
then
675 ierr=nf_put_var_double(nid,id_fsic,phy_glo)
677 ierr=nf_put_var_real(nid,id_fsic,phy_glo)
679 if(ierr.ne.nf_noerr)
then
680 write(*,*)
"writelim error with phy_fsic"
681 write(*,*) nf_strerror(ierr)
685 call
gather(phy_flic,phy_glo)
686 if (is_mpi_root.and.is_omp_root)
then
688 ierr=nf_put_var_double(nid,id_flic,phy_glo)
690 ierr=nf_put_var_real(nid,id_flic,phy_glo)
692 if(ierr.ne.nf_noerr)
then
693 write(*,*)
"writelim error with phy_flic"
694 write(*,*) nf_strerror(ierr)
699 if (is_mpi_root.and.is_omp_root)
then
711 INTEGER nlon, type_profil,
i,
k,
j
712 REAL ::
rlatd(nlon), phy_sst(nlon, 360)
713 INTEGER imn,
imx, amn, amx, kmn, kmx
714 INTEGER p, pplus, nlat_max
716 REAL x_anom_sst(nlat_max)
718 if (klon.ne.nlon) stop
'probleme de dimensions dans iniaqua'
724 if(type_profil.EQ.1)
then
727 phy_sst(
j,
i)=273.+27.*(1-sin(1.5*
rlatd(
j))**2)
729 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
734 if(type_profil.EQ.2)
then
737 phy_sst(
j,
i)=273.+27.*(1-sin(1.5*
rlatd(
j))**4)
738 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
745 if (type_profil.EQ.3)
then
748 phy_sst(
j,
i)=273.+0.5*27.*(2-sin(1.5*
rlatd(
j))**2
750 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
756 if (type_profil.EQ.4)
then
759 phy_sst(
j,
i)=273.+0.5*29.*(2-sin(1.5*
rlatd(
j))**2
761 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
767 if (type_profil.EQ.5)
then
770 phy_sst(
j,
i)=273.+2.+0.5*27.*(2-sin(1.5*
rlatd(
j))**2
772 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
779 if(type_profil.EQ.6)
then
787 if(type_profil.EQ.7)
then
795 if(type_profil.EQ.8)
then
799 phy_sst(
j,
i)=273.+x_anom_sst(pplus)
800 & +0.5*27.*(2-sin(1.5*
rlatd(
j))**2-sin(1.5*
rlatd(
j))**4)
801 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
802 phy_sst(
j,
i)=273.+x_anom_sst(pplus)
807 phy_sst(
j,
i)=273.+x_anom_sst(pplus)
808 & +0.5*27.*(2-sin(1.5*
rlatd(
j))**2-sin(1.5*
rlatd(
j))**4)
809 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
810 phy_sst(
j,
i)=273.+x_anom_sst(pplus)
812 write (*,*)
rlatd(
j),x_anom_sst(pplus),phy_sst(
j,
i)
817 if (type_profil.EQ.9)
then
820 phy_sst(
j,
i)=273.-2.+0.5*27.*(2-sin(1.5*
rlatd(
j))**2
822 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
829 if (type_profil.EQ.10)
then
832 phy_sst(
j,
i)=273.+4.+0.5*27.*(2-sin(1.5*
rlatd(
j))**2
834 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
840 if (type_profil.EQ.11)
then
843 phy_sst(
j,
i)=273.+0.5*27.*(2-sin(1.5*
rlatd(
j))**2
845 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
851 if (type_profil.EQ.12)
then
854 phy_sst(
j,
i)=273.+4.+0.5*27.*(2-sin(1.5*
rlatd(
j))**2
856 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
862 if (type_profil.EQ.13)
then
865 phy_sst(
j,
i)=273.+0.5*29.*(2-sin(1.5*
rlatd(
j))**2
867 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
873 if (type_profil.EQ.14)
then
876 phy_sst(
j,
i)=273.+2.+0.5*29.*(2-sin(1.5*
rlatd(
j))**2
878 if((
rlatd(
j).GT.1.0471975).OR.(
rlatd(
j).LT.-1.0471975))
then
887 amn=min(phy_sst(1,1),1000.)
888 amx=max(phy_sst(1,1),-1000.)
891 IF(phy_sst(
i,
k).LT.amn)
THEN
896 IF(phy_sst(
i,
k).GT.amx)
THEN
904 print*,
' debut avant writelim min max phy_sst',imn,kmn,amn,