[4] | 1 | module lect_topo_hemin40 |
---|
| 2 | |
---|
| 3 | use module3D_phy |
---|
[46] | 4 | use interface_input |
---|
| 5 | use io_netcdf_grisli |
---|
| 6 | |
---|
| 7 | implicit none |
---|
[4] | 8 | |
---|
[46] | 9 | character(len=100) :: topo_dep ! Topo de départ |
---|
| 10 | character(len=100) :: topo_ref ! Topo de référence |
---|
| 11 | character(len=100) :: grid_topo ! fichier grille |
---|
| 12 | character(len=100) :: ghf_fich ! fichier grille |
---|
| 13 | character(len=80) :: filin |
---|
| 14 | real, dimension(nx,ny,5) :: bidon ! pour l'appel a courbure |
---|
| 15 | character(len=100) :: file_ncdf !< fichier netcdf issue des fichiers .dat |
---|
[4] | 16 | |
---|
| 17 | contains |
---|
| 18 | |
---|
| 19 | subroutine input_topo |
---|
| 20 | |
---|
[46] | 21 | integer :: ios |
---|
| 22 | |
---|
| 23 | namelist/topo_file/topo_ref,topo_dep,grid_topo,ghf_fich |
---|
| 24 | rewind(num_param) ! pour revenir au debut du fichier param_list.dat |
---|
| 25 | read(num_param,topo_file) |
---|
[9] | 26 | ! formats pour les ecritures dans 42 |
---|
| 27 | 428 format(A) |
---|
[46] | 28 | write(num_rep_42,428)'!___________________________________________________________' |
---|
| 29 | write(num_rep_42,428) '&topo_file ! nom du bloc ' |
---|
| 30 | write(num_rep_42,*) |
---|
| 31 | write(num_rep_42,'(A,A)') 'topo_ref = ', topo_ref |
---|
| 32 | write(num_rep_42,'(A,A)') 'topo_dep = ', topo_dep |
---|
| 33 | write(num_rep_42,'(A,A)') 'grid_topo =', grid_topo |
---|
| 34 | write(num_rep_42,'(A,A)') 'ghf_fich = ', ghf_fich |
---|
| 35 | write(num_rep_42,*)'/' |
---|
| 36 | write(num_rep_42,428) '! topo_ref= topo ref isostasie' |
---|
| 37 | write(num_rep_42,428) '! topo_dep= topo de depart' |
---|
| 38 | write(num_rep_42,428) '! grid_topo : fichier i,j,x,y,lon,lat' |
---|
| 39 | write(num_rep_42,428) '! ghf_fich : fichier flux geothermique' |
---|
| 40 | write(num_rep_42,*) |
---|
[9] | 41 | |
---|
[47] | 42 | topo_ref=trim(dirnameinp)//trim(topo_ref) |
---|
| 43 | topo_dep=trim(dirnameinp)//trim(topo_dep) |
---|
| 44 | grid_topo=trim(dirnameinp)//trim(grid_topo) |
---|
| 45 | ghf_fich=trim(dirnameinp)//trim(ghf_fich) |
---|
| 46 | |
---|
[46] | 47 | !write(num_rep_42,*) 'file1 = ', file1 |
---|
| 48 | !write(num_rep_42,*) 'file2 = ', file2 |
---|
| 49 | !write(num_rep_42,*)'/' |
---|
| 50 | !write(num_rep_42,428) '! file1 : topo de depart' |
---|
| 51 | !write(num_rep_42,428) '! file2 : topo de reference' |
---|
| 52 | !write(num_rep_42,*) |
---|
| 53 | |
---|
[4] | 54 | !====================================== La reponse est 42 =========== |
---|
[9] | 55 | ! write(42,*) |
---|
| 56 | ! write(42,*)' Fichiers en entree' |
---|
| 57 | ! write(42,*)'----------------------' |
---|
[4] | 58 | !==================================================================== |
---|
| 59 | |
---|
[9] | 60 | ! dans param : |
---|
| 61 | ! file1=TRIM(DIRNAMEINP)//'topo-21k.g40' ! topo LGM ICE_5G (1=topo de depart) |
---|
[4] | 62 | ! file1=TRIM(DIRNAMEINP)//'hemin2.g40' |
---|
[9] | 63 | ! file2=TRIM(DIRNAMEINP)//'hemin2.g40' ! topo actuelle |
---|
| 64 | ! write(42,*) 'topo de depart', file1 |
---|
| 65 | ! write(42,*) 'topo reference', file2 |
---|
[4] | 66 | |
---|
| 67 | |
---|
[46] | 68 | !!$! lecture adaptee aux fichiers intercomparaison EISMINT |
---|
| 69 | !!$ nxx=nx |
---|
| 70 | !!$ nyy=ny |
---|
[4] | 71 | |
---|
[46] | 72 | !!$! lecture de la topo actuelle |
---|
| 73 | !!$! --------------------------- |
---|
| 74 | !!$ open (20,file=TRIM(DIRNAMEINP)//file2,status='old') |
---|
| 75 | !!$ |
---|
| 76 | !!$ read(20,'(A80)') TITRE |
---|
| 77 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
| 78 | !!$ read(20,*) |
---|
| 79 | !!$ do J=1,ny |
---|
| 80 | !!$ do I=1,nx |
---|
| 81 | !!$ read (20,*) S0(I,J),H0(I,J),BSOC0(I,J) |
---|
| 82 | !!$ S0(i,j)=max(S0(i,j),0.) |
---|
| 83 | !!$ end do |
---|
| 84 | !!$ end do |
---|
| 85 | !!$ close(20) |
---|
| 86 | !!$ |
---|
| 87 | !!$ |
---|
| 88 | !!$! lecture de la topo de depart |
---|
| 89 | !!$! --------------------------- |
---|
| 90 | !!$ open (20,file=TRIM(DIRNAMEINP)//file1,status='old') |
---|
| 91 | !!$! open (20,file='../INPUT-DATA/hemin.g50') |
---|
| 92 | !!$ read(20,'(A80)') TITRE |
---|
| 93 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
| 94 | !!$ read(20,*) |
---|
| 95 | !!$ do J=1,ny |
---|
| 96 | !!$ do I=1,nx |
---|
| 97 | !!$ read (20,*) S(I,J),H(I,J),BSOC(I,J) |
---|
| 98 | !!$ end do |
---|
| 99 | !!$ end do |
---|
| 100 | !!$ close(20) |
---|
[4] | 101 | |
---|
[9] | 102 | |
---|
[46] | 103 | ! lecture de la topo de référence |
---|
| 104 | call lect_input(1,'Bsoc',1,Bsoc0,topo_ref,file_ncdf) ! socle |
---|
| 105 | call lect_input(1,'S',1,S0,topo_ref,file_ncdf) ! surface |
---|
| 106 | call lect_input(1,'H',1,H0,topo_ref,file_ncdf) ! epaisseur |
---|
| 107 | |
---|
| 108 | |
---|
[9] | 109 | ! calcul des courbures du socle |
---|
| 110 | call courbure(nx,ny,dx,Bsoc,bidon(:,:,1),bidon(:,:,2),bidon(:,:,3), & |
---|
| 111 | bidon(:,:,4),socle_cry,bidon(:,:,5)) |
---|
| 112 | socle_cry(:,:)=socle_cry(:,:)*dx*dx |
---|
| 113 | |
---|
[4] | 114 | ! lecture des coordonnées geographiques |
---|
| 115 | |
---|
[47] | 116 | ! filin=TRIM(DIRNAMEINP)//grid_topo |
---|
[4] | 117 | |
---|
| 118 | ! les coordonnees sont calculees en °dec avec GMT, |
---|
| 119 | ! les longitudes sont comprises entre -180 et +180 (negative a l'Ouest de |
---|
| 120 | ! Greenwich et positive a l'Est) |
---|
[47] | 121 | open(unit=2004,file=grid_topo,iostat=ios) |
---|
[9] | 122 | do k=1,nx*ny |
---|
| 123 | read(2004,*) i,j,XCC(i,j),YCC(i,j),XLONG(i,j),YLAT(i,j) |
---|
| 124 | enddo |
---|
| 125 | close(2004) |
---|
| 126 | write(42,*) 'fichier grille: ', filin |
---|
[4] | 127 | |
---|
[9] | 128 | xmin=xcc(1,1)/1000. |
---|
| 129 | ymin=ycc(1,1)/1000. |
---|
| 130 | xmax=xcc(nx,ny)/1000. |
---|
| 131 | ymax=ycc(nx,ny)/1000. |
---|
| 132 | |
---|
[4] | 133 | ! lecture du flux geothermique de Shapiro |
---|
[46] | 134 | ! open(88,file=TRIM(DIRNAMEINP)//'ijphi_hemin40.dat') |
---|
[47] | 135 | ! open(88,file=ghf_fich) |
---|
[4] | 136 | |
---|
[46] | 137 | !!$ write(42,*) 'flux geothermique Shapiro : ',TRIM(DIRNAMEINP)//'ijphi_hemin40.dat' |
---|
| 138 | !!$ do k=1,nx*ny |
---|
| 139 | !!$ read(88,*) i,j,ghf(i,j) |
---|
| 140 | !!$ end do |
---|
| 141 | !!$ close(88) |
---|
[4] | 142 | |
---|
[46] | 143 | call lect_input(1,'ghf',1,ghf,ghf_fich,file_ncdf) |
---|
| 144 | |
---|
[4] | 145 | ! pour passer les flux des mW/m2 au J/m2/an |
---|
[9] | 146 | ghf(:,:)=-SECYEAR/1000.*ghf(:,:) |
---|
[4] | 147 | ! write(42,*) 'flux geothermique fixe : 55 mW/m2' |
---|
| 148 | ! ghf(:,:)=-SECYEAR/1000.*55. !B6norcg2 |
---|
| 149 | |
---|
[9] | 150 | ! print*,'lect topo' |
---|
| 151 | ! print*,'shb',S(101,91),H(101,91),B(101,91) |
---|
| 152 | ! print*,'shb0',S0(101,91),H0(101,91),BSOC0(101,91) |
---|
[4] | 153 | ! Initialisation du Masque |
---|
| 154 | !------------------------------------------------ |
---|
| 155 | ! pour l'Hemisphere Nord mko vrai partout (version 2006) |
---|
| 156 | MK0(:,:)=1 |
---|
| 157 | |
---|
| 158 | !------------------------------------------------ |
---|
| 159 | end subroutine input_topo |
---|
| 160 | |
---|
| 161 | end module lect_topo_hemin40 |
---|