1 | !> \file lect-Ant_CISM_45_dat.f90 |
---|
2 | !! Module pour la lecture de la topographie |
---|
3 | !< |
---|
4 | |
---|
5 | !> \namespace lect_topo_ant_CISM_45 |
---|
6 | !! Module pour la lecture de la topographie |
---|
7 | !! \author ... |
---|
8 | !! \date ... |
---|
9 | !! @note Used module |
---|
10 | !! @note - use module3D_phy |
---|
11 | !! @note - use param_phy_mod |
---|
12 | !< |
---|
13 | |
---|
14 | module lect_topo_ant_CISM_45 |
---|
15 | |
---|
16 | use module3D_phy |
---|
17 | use interface_input |
---|
18 | character(len=100) :: topo_surf !< surface |
---|
19 | character(len=100) :: correc_surf !< ice-real correction |
---|
20 | character(len=100) :: topo_thick !< thickness |
---|
21 | character(len=100) :: topo_bed !< bedrock |
---|
22 | character(len=100) :: mask_grounded !< mask |
---|
23 | character(len=100) :: longitude !< longitude |
---|
24 | character(len=100) :: latitude !< latitude |
---|
25 | character(len=100) :: heatflux !< geothermal heat flux |
---|
26 | |
---|
27 | real,dimension(nx,ny) :: work_tab |
---|
28 | Character(len=100) :: file_ncdf !< fichier netcdf issue des fichiers .dat |
---|
29 | |
---|
30 | contains |
---|
31 | |
---|
32 | subroutine input_topo |
---|
33 | |
---|
34 | namelist/topo_CISM_45/topo_surf,correc_surf,topo_thick,topo_bed,mask_grounded,longitude,latitude,heatflux |
---|
35 | |
---|
36 | 428 format(A) |
---|
37 | |
---|
38 | rewind(num_param) ! pour revenir au debut du fichier param_list.dat |
---|
39 | read(num_param,topo_CISM_45) |
---|
40 | |
---|
41 | write(num_rep_42,428)'!___________________________________________________________' |
---|
42 | write(num_rep_42,428)'! module lect_topo_ant_CISM ' |
---|
43 | write(num_rep_42,topo_CISM_45) |
---|
44 | write(num_rep_42,428)'!___________________________________________________________' |
---|
45 | |
---|
46 | |
---|
47 | topo_surf = trim(dirnameinp)//trim(topo_surf) |
---|
48 | correc_surf = trim(dirnameinp)//trim(correc_surf) |
---|
49 | topo_thick = trim(dirnameinp)//trim(topo_thick) |
---|
50 | topo_bed = trim(dirnameinp)//trim(topo_bed) |
---|
51 | mask_grounded = trim(dirnameinp)//trim(mask_grounded) |
---|
52 | longitude = trim(dirnameinp)//trim(longitude) |
---|
53 | latitude = trim(dirnameinp)//trim(latitude) |
---|
54 | heatflux = trim(dirnameinp)//trim(heatflux) |
---|
55 | |
---|
56 | ! Transformation des fichiers .dat en .nc |
---|
57 | file_ncdf= trim(dirnameinp)//trim(runname)//'.nc' |
---|
58 | |
---|
59 | ! lecture adaptee aux fichiers ZBL.dat |
---|
60 | |
---|
61 | call lect_input(3,'Bsoc',1,Bsoc,topo_bed,file_ncdf) |
---|
62 | !call lect_datfile(nx,ny,Bsoc,1,topo_bed) ! bedrock |
---|
63 | |
---|
64 | Bsoc0(:,:) = Bsoc(:,:) |
---|
65 | |
---|
66 | |
---|
67 | call lect_input(3,'S',1,S,topo_surf,file_ncdf) |
---|
68 | !call lect_datfile(nx,ny,S,1,topo_surf) ! surface |
---|
69 | |
---|
70 | call lect_input(3,'H',1,H,topo_thick,file_ncdf) |
---|
71 | !call lect_datfile(nx,ny,H,1,topo_thick) ! thickness |
---|
72 | |
---|
73 | call lect_input(3,'work_tab1',1,work_tab,correc_surf,file_ncdf) |
---|
74 | !call lect_datfile(nx,ny,work_tab,1,correc_surf) ! density correction |
---|
75 | |
---|
76 | where (H(:,:).gt.0.) |
---|
77 | work_tab(:,:)=min(H(:,:),work_tab(:,:)) |
---|
78 | S(:,:) = S(:,:) - work_tab(:,:) ! corrected surface |
---|
79 | H(:,:) = H(:,:) - work_tab(:,:) ! corrected thickness |
---|
80 | end where |
---|
81 | H(:,:)=max(0.,H(:,:)) |
---|
82 | H0(:,:)= H(:,:) |
---|
83 | S0(:,:)= S(:,:) |
---|
84 | |
---|
85 | call lect_input(3,'work_tab2',1,work_tab,mask_grounded,file_ncdf) |
---|
86 | !call lect_datfile(nx,ny,work_tab,2,mask_grounded) ! masque |
---|
87 | |
---|
88 | mk0(:,:) = int(work_tab) |
---|
89 | ! Le masque iceberg est 0 quand glace et 1 quand mer |
---|
90 | where (mk0(:,:).eq.1) |
---|
91 | H(:,:)=0. |
---|
92 | S(:,:)=0. |
---|
93 | H0(:,:)= H(:,:) |
---|
94 | S0(:,:)= S(:,:) |
---|
95 | end where |
---|
96 | |
---|
97 | ! pour l'Antarctique masque mko vrai partout (version 2006) |
---|
98 | MK0(:,:)=1 |
---|
99 | |
---|
100 | ! determination des flot |
---|
101 | do j=1,ny |
---|
102 | do i=1,nx |
---|
103 | if ((Bsoc(i,j)+H(i,j)*ro/row -sealevel).lt.0.) then |
---|
104 | flot(i,j)=.true. |
---|
105 | else |
---|
106 | flot(i,j)=.false. |
---|
107 | endif |
---|
108 | enddo |
---|
109 | enddo |
---|
110 | |
---|
111 | ! le calcul des courbures du socle devrait etre dans le dragging |
---|
112 | |
---|
113 | call lect_input(1,'Xlong',1,Xlong,longitude,file_ncdf) |
---|
114 | ! call lect_datfile(nx,ny,Xlong,1,longitude) ! lecture des coordonnées geographiques |
---|
115 | |
---|
116 | call lect_input(1,'Ylat',1,Ylat,latitude,file_ncdf) |
---|
117 | ! call lect_datfile(nx,ny,Ylat,1,latitude) |
---|
118 | |
---|
119 | open(22,file=longitude) |
---|
120 | read(22,*) i,i,xmin,xmax,ymin,xmax |
---|
121 | xmin=xmin/1000. |
---|
122 | ymin=ymin/1000. |
---|
123 | xmax=xmax/1000. |
---|
124 | ymax=ymax/1000. |
---|
125 | close(22) |
---|
126 | |
---|
127 | |
---|
128 | ! lecture du fichier de reference pour le calcul du niveau des mers : etat actuel |
---|
129 | ! pas de version correcte pour l'instant -> valeurs initiales |
---|
130 | S_sealev(:,:) = S0(:,:) |
---|
131 | H_sealev(:,:) = H0(:,:) |
---|
132 | B_sealev(:,:) = Bsoc(:,:) |
---|
133 | M_sealev(:,:) = Mk0(:,:) |
---|
134 | |
---|
135 | |
---|
136 | call lect_input(1,'ghf',1,ghf,heatflux,file_ncdf) |
---|
137 | !call lect_datfile(nx,ny,ghf,1,heatflux) |
---|
138 | |
---|
139 | |
---|
140 | ! for the purposes of SeaRISE, GTHF should be capped at a value of -0.07 w/m^2, |
---|
141 | ! and the field provided in the netCDF file does not include these updated values |
---|
142 | |
---|
143 | ghf(:,:)=min(ghf(:,:),0.07) |
---|
144 | |
---|
145 | ! pour passer les flux des W/m2 au J/m2/an |
---|
146 | ghf(:,:)=-SECYEAR*ghf(:,:) |
---|
147 | |
---|
148 | |
---|
149 | end subroutine input_topo |
---|
150 | |
---|
151 | |
---|
152 | end module lect_topo_ant_CISM_45 |
---|