[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 | |
---|
[46] | 42 | !write(num_rep_42,*) 'file1 = ', file1 |
---|
| 43 | !write(num_rep_42,*) 'file2 = ', file2 |
---|
| 44 | !write(num_rep_42,*)'/' |
---|
| 45 | !write(num_rep_42,428) '! file1 : topo de depart' |
---|
| 46 | !write(num_rep_42,428) '! file2 : topo de reference' |
---|
| 47 | !write(num_rep_42,*) |
---|
| 48 | |
---|
[4] | 49 | !====================================== La reponse est 42 =========== |
---|
[9] | 50 | ! write(42,*) |
---|
| 51 | ! write(42,*)' Fichiers en entree' |
---|
| 52 | ! write(42,*)'----------------------' |
---|
[4] | 53 | !==================================================================== |
---|
| 54 | |
---|
[9] | 55 | ! dans param : |
---|
| 56 | ! file1=TRIM(DIRNAMEINP)//'topo-21k.g40' ! topo LGM ICE_5G (1=topo de depart) |
---|
[4] | 57 | ! file1=TRIM(DIRNAMEINP)//'hemin2.g40' |
---|
[9] | 58 | ! file2=TRIM(DIRNAMEINP)//'hemin2.g40' ! topo actuelle |
---|
| 59 | ! write(42,*) 'topo de depart', file1 |
---|
| 60 | ! write(42,*) 'topo reference', file2 |
---|
[4] | 61 | |
---|
| 62 | |
---|
[46] | 63 | !!$! lecture adaptee aux fichiers intercomparaison EISMINT |
---|
| 64 | !!$ nxx=nx |
---|
| 65 | !!$ nyy=ny |
---|
[4] | 66 | |
---|
[46] | 67 | !!$! lecture de la topo actuelle |
---|
| 68 | !!$! --------------------------- |
---|
| 69 | !!$ open (20,file=TRIM(DIRNAMEINP)//file2,status='old') |
---|
| 70 | !!$ |
---|
| 71 | !!$ read(20,'(A80)') TITRE |
---|
| 72 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
| 73 | !!$ read(20,*) |
---|
| 74 | !!$ do J=1,ny |
---|
| 75 | !!$ do I=1,nx |
---|
| 76 | !!$ read (20,*) S0(I,J),H0(I,J),BSOC0(I,J) |
---|
| 77 | !!$ S0(i,j)=max(S0(i,j),0.) |
---|
| 78 | !!$ end do |
---|
| 79 | !!$ end do |
---|
| 80 | !!$ close(20) |
---|
| 81 | !!$ |
---|
| 82 | !!$ |
---|
| 83 | !!$! lecture de la topo de depart |
---|
| 84 | !!$! --------------------------- |
---|
| 85 | !!$ open (20,file=TRIM(DIRNAMEINP)//file1,status='old') |
---|
| 86 | !!$! open (20,file='../INPUT-DATA/hemin.g50') |
---|
| 87 | !!$ read(20,'(A80)') TITRE |
---|
| 88 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
| 89 | !!$ read(20,*) |
---|
| 90 | !!$ do J=1,ny |
---|
| 91 | !!$ do I=1,nx |
---|
| 92 | !!$ read (20,*) S(I,J),H(I,J),BSOC(I,J) |
---|
| 93 | !!$ end do |
---|
| 94 | !!$ end do |
---|
| 95 | !!$ close(20) |
---|
[4] | 96 | |
---|
[9] | 97 | |
---|
[46] | 98 | ! lecture de la topo de référence |
---|
| 99 | call lect_input(1,'Bsoc',1,Bsoc0,topo_ref,file_ncdf) ! socle |
---|
| 100 | call lect_input(1,'S',1,S0,topo_ref,file_ncdf) ! surface |
---|
| 101 | call lect_input(1,'H',1,H0,topo_ref,file_ncdf) ! epaisseur |
---|
| 102 | |
---|
| 103 | |
---|
[9] | 104 | ! calcul des courbures du socle |
---|
| 105 | call courbure(nx,ny,dx,Bsoc,bidon(:,:,1),bidon(:,:,2),bidon(:,:,3), & |
---|
| 106 | bidon(:,:,4),socle_cry,bidon(:,:,5)) |
---|
| 107 | socle_cry(:,:)=socle_cry(:,:)*dx*dx |
---|
| 108 | |
---|
[4] | 109 | ! lecture des coordonnées geographiques |
---|
| 110 | |
---|
| 111 | filin=TRIM(DIRNAMEINP)//'coord-nord-40km.dat' |
---|
| 112 | |
---|
| 113 | ! les coordonnees sont calculees en °dec avec GMT, |
---|
| 114 | ! les longitudes sont comprises entre -180 et +180 (negative a l'Ouest de |
---|
| 115 | ! Greenwich et positive a l'Est) |
---|
[9] | 116 | open(unit=2004,file=filin,iostat=ios) |
---|
| 117 | do k=1,nx*ny |
---|
| 118 | read(2004,*) i,j,XCC(i,j),YCC(i,j),XLONG(i,j),YLAT(i,j) |
---|
| 119 | enddo |
---|
| 120 | close(2004) |
---|
| 121 | write(42,*) 'fichier grille: ', filin |
---|
[4] | 122 | |
---|
[9] | 123 | xmin=xcc(1,1)/1000. |
---|
| 124 | ymin=ycc(1,1)/1000. |
---|
| 125 | xmax=xcc(nx,ny)/1000. |
---|
| 126 | ymax=ycc(nx,ny)/1000. |
---|
| 127 | |
---|
[4] | 128 | ! lecture du flux geothermique de Shapiro |
---|
[46] | 129 | ! open(88,file=TRIM(DIRNAMEINP)//'ijphi_hemin40.dat') |
---|
| 130 | open(88,file=ghf_fich) |
---|
[4] | 131 | |
---|
[46] | 132 | !!$ write(42,*) 'flux geothermique Shapiro : ',TRIM(DIRNAMEINP)//'ijphi_hemin40.dat' |
---|
| 133 | !!$ do k=1,nx*ny |
---|
| 134 | !!$ read(88,*) i,j,ghf(i,j) |
---|
| 135 | !!$ end do |
---|
| 136 | !!$ close(88) |
---|
[4] | 137 | |
---|
[46] | 138 | call lect_input(1,'ghf',1,ghf,ghf_fich,file_ncdf) |
---|
| 139 | |
---|
[4] | 140 | ! pour passer les flux des mW/m2 au J/m2/an |
---|
[9] | 141 | ghf(:,:)=-SECYEAR/1000.*ghf(:,:) |
---|
[4] | 142 | ! write(42,*) 'flux geothermique fixe : 55 mW/m2' |
---|
| 143 | ! ghf(:,:)=-SECYEAR/1000.*55. !B6norcg2 |
---|
| 144 | |
---|
[9] | 145 | ! print*,'lect topo' |
---|
| 146 | ! print*,'shb',S(101,91),H(101,91),B(101,91) |
---|
| 147 | ! print*,'shb0',S0(101,91),H0(101,91),BSOC0(101,91) |
---|
[4] | 148 | ! Initialisation du Masque |
---|
| 149 | !------------------------------------------------ |
---|
| 150 | ! pour l'Hemisphere Nord mko vrai partout (version 2006) |
---|
| 151 | MK0(:,:)=1 |
---|
| 152 | |
---|
| 153 | !------------------------------------------------ |
---|
| 154 | end subroutine input_topo |
---|
| 155 | |
---|
| 156 | end module lect_topo_hemin40 |
---|