Changeset 186 for trunk/MESOSCALE/LMD_MM_MARS
- Timestamp:
- Jul 3, 2011, 4:27:24 AM (13 years ago)
- Location:
- trunk/MESOSCALE/LMD_MM_MARS/SRC/POSTPROC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/LMD_MM_MARS/SRC/POSTPROC/api.F90
r112 r186 35 35 INCLUDE 'netcdf.inc' 36 36 37 ! 38 ! VARIABLES 39 ! 40 CHARACTER (LEN=500) :: path_to_input 41 CHARACTER (LEN=500) :: path_to_output 42 CHARACTER (LEN=500) :: input_name 43 CHARACTER (LEN=500) :: output_name 44 CHARACTER (LEN=20) :: process 45 CHARACTER (LEN=2000) :: fields 46 REAL, DIMENSION(299) :: interp_levels 47 INTEGER :: interp_method=1 48 INTEGER :: extrapolate=0 49 LOGICAL :: debug=.FALSE. 50 LOGICAL :: unstagger_grid=.FALSE. 51 LOGICAL :: bit64=.FALSE. 52 LOGICAL :: oldvar=.TRUE. 53 54 INTEGER :: funit,ios 55 LOGICAL :: is_used 56 57 ! 58 ! NAMELISTS 59 ! 60 NAMELIST /io/ path_to_input, input_name, path_to_output, output_name, & 61 process, fields, debug, bit64, oldvar 62 NAMELIST /interp_in/ interp_levels, interp_method, extrapolate, unstagger_grid 63 64 ! 65 ! DEFAULT VALUES for VARIABLES 66 ! 67 path_to_input = './' 68 path_to_output = './' 69 output_name = ' ' 70 interp_levels = -99999. 71 process = 'all' 72 73 74 ! 75 ! READ NAMELIST 76 ! 77 DO funit=10,100 78 INQUIRE(unit=funit, opened=is_used) 79 IF (.not. is_used) EXIT 80 END DO 81 OPEN(funit,file='namelist.api',status='old',form='formatted',iostat=ios) 82 IF ( ios /= 0 ) STOP "ERROR opening namelist.api" 83 READ(funit,io) 84 READ(funit,interp_in) 85 CLOSE(funit) 86 87 !!! MAIN CALL 88 CALL api_main ( path_to_input, input_name, path_to_output, output_name, & 89 process, fields, debug, bit64, oldvar, & 90 interp_levels, interp_method, extrapolate, unstagger_grid, -99999. ) 91 92 END PROGRAM api 93 94 SUBROUTINE api_main ( path_to_input, input_name, path_to_output, output_name, & 95 process, fields, debug, bit64, oldvar, & 96 interp_levels, interp_method, extrapolate, unstagger_grid, onelevel ) 97 98 IMPLICIT NONE 99 INCLUDE 'netcdf.inc' 100 37 101 !! 38 102 !! EARTH CONSTANTS … … 62 126 CHARACTER, ALLOCATABLE, DIMENSION(:,:,:,:) :: text 63 127 CHARACTER (LEN=31),ALLOCATABLE, DIMENSION(:) :: dnamei, dnamej 64 CHARACTER(LEN= 250),ALLOCATABLE, DIMENSION(:) :: input_file_names65 CHARACTER(LEN= 250),ALLOCATABLE, DIMENSION(:) :: output_file_names128 CHARACTER(LEN=500),ALLOCATABLE, DIMENSION(:) :: input_file_names 129 CHARACTER(LEN=500),ALLOCATABLE, DIMENSION(:) :: output_file_names 66 130 DOUBLE PRECISION, ALLOCATABLE, DIMENSION(:,:,:,:) :: ddata1, ddata2 67 131 REAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: data1, data2, data3 … … 79 143 INTEGER, DIMENSION(4) :: dims_in, dims_out 80 144 INTEGER, DIMENSION(6) :: ishape, jshape 81 CHARACTER (LEN= 80) :: cval145 CHARACTER (LEN=500) :: cval !80 82 146 CHARACTER (LEN=31) :: cname, test_dim_name 83 CHARACTER (LEN= 80) :: input_file, output_file, att_text84 CHARACTER (LEN= 250) :: path_to_input85 CHARACTER (LEN= 250) :: path_to_output86 CHARACTER (LEN= 250) :: input_name87 CHARACTER (LEN= 250) :: output_name, tmp_name147 CHARACTER (LEN=500) :: input_file, output_file, att_text !80 148 CHARACTER (LEN=500) :: path_to_input 149 CHARACTER (LEN=500) :: path_to_output 150 CHARACTER (LEN=500) :: input_name 151 CHARACTER (LEN=500) :: output_name, tmp_name 88 152 CHARACTER (LEN=10) :: option 89 153 CHARACTER (LEN=132) :: command 90 154 CHARACTER (LEN=20) :: process, dummy 91 155 CHARACTER (LEN=2000) :: fields, process_these_fields 92 REAL, DIMENSION(299) :: interp_levels 156 REAL, DIMENSION(299) :: interp_levels 93 157 REAL :: rval 94 158 REAL :: MISSING=1.e36 … … 96 160 INTEGER :: map_proj 97 161 INTEGER :: LINLOG = 1 98 INTEGER :: interp_method =199 INTEGER :: extrapolate =0162 INTEGER :: interp_method!=1 163 INTEGER :: extrapolate!=0 100 164 INTEGER :: ncid, mcid, rcode 101 165 INTEGER :: idm, ndims, nvars, natt, ngatts … … 111 175 INTEGER :: kk 112 176 LOGICAL :: is_used 113 LOGICAL :: debug =.FALSE.177 LOGICAL :: debug!=.FALSE. 114 178 LOGICAL :: interpolate=.FALSE. 115 LOGICAL :: unstagger_grid =.FALSE.179 LOGICAL :: unstagger_grid!=.FALSE. 116 180 LOGICAL :: fix_meta_stag=.FALSE. 117 LOGICAL :: bit64 =.FALSE.181 LOGICAL :: bit64!=.FALSE. 118 182 LOGICAL :: first=.TRUE. 119 LOGICAL :: oldvar=.FALSE. 120 121 ! 122 ! NAMELISTS 123 ! 124 NAMELIST /io/ path_to_input, input_name, path_to_output, output_name, & 125 process, fields, debug, bit64, oldvar 126 NAMELIST /interp_in/ interp_levels, interp_method, extrapolate, unstagger_grid 127 128 ! 129 ! DEFAULT VALUES for VARIABLES 130 ! 131 path_to_input = './' 132 path_to_output = './' 133 output_name = ' ' 134 interp_levels = -99999. 135 process = 'all' 136 137 ! 138 ! READ NAMELIST 139 ! 140 DO funit=10,100 141 INQUIRE(unit=funit, opened=is_used) 142 IF (.not. is_used) EXIT 143 END DO 144 OPEN(funit,file='namelist.api',status='old',form='formatted',iostat=ios) 145 IF ( ios /= 0 ) STOP "ERROR opening namelist.api" 146 READ(funit,io) 147 READ(funit,interp_in) 148 CLOSE(funit) 183 LOGICAL :: oldvar!=.FALSE. 184 185 REAL :: onelevel 186 if ( onelevel .ne. -99999. ) then 187 interp_levels(1) = onelevel 188 interp_levels(2:) = -99999. 189 endif 149 190 150 191 ! … … 152 193 ! 153 194 lent = len_trim(path_to_input) 154 IF ( path_to_input(lent:lent) /= "/" ) THEN155 path_to_input = TRIM(path_to_input)//"/"156 ENDIF157 lent = len_trim(path_to_output)158 IF ( path_to_output(lent:lent) /= "/" ) THEN159 path_to_output = TRIM(path_to_output)//"/"160 ENDIF195 !IF ( path_to_input(lent:lent) /= "/" ) THEN 196 ! path_to_input = TRIM(path_to_input)//"/" 197 !ENDIF 198 !lent = len_trim(path_to_output) 199 !IF ( path_to_output(lent:lent) /= "/" ) THEN 200 ! path_to_output = TRIM(path_to_output)//"/" 201 !ENDIF 161 202 input_name = TRIM(path_to_input)//TRIM(input_name) 162 203 ! … … 526 567 write(6,*) " Data will be output on unstaggered grid " 527 568 do kk = 1, times_in_file 528 IF ( DEBUG ) print *, kk569 !IF ( DEBUG ) print *, kk 529 570 IF (oldvar) THEN 530 571 interm1(1:iweg-1,:,:) = ( u(1:iweg-1,:,:,kk) + u(2:iweg,:,:,kk) ) * .5 … … 673 714 ENDDO 674 715 deallocate (data1) 675 PRINT *, pres_field(10,10,:,1)716 !PRINT *, pres_field(10,10,:,1) 676 717 ENDIF 677 718 … … 949 990 DO ii = 1,4 950 991 dims_out(ii) = dvalj(jshape(ii)) 951 print *, dims_out(ii)992 !print *, dims_out(ii) 952 993 ENDDO 953 994 !!! NB: what follows is useful because we'd like diagnostics for each history timestep … … 1134 1175 write(6,*) "##########################################" 1135 1176 1136 END PROGRAM api 1177 END SUBROUTINE 1178 ! END PROGRAM api 1137 1179 !--------------------------------------------------------------------- 1138 1180 !--------------------------------------------------------------------- … … 1573 1615 real, parameter :: RAD_PER_DEG = PI/180. 1574 1616 1575 ! print *, 'map ', map_proj1576 1617 IF ( map_proj .ge. 3 ) THEN ! No need to rotate 1577 1618 !PRINT *, 'NO NEED TO ROTATE !!!! equivalent to output U,V with unstagger_grid' … … 1579 1620 VVVmet(:,:,:) = VVV 1580 1621 ELSE 1581 !END IF1582 1622 1583 1623 cone = 1. ! PS … … 1606 1646 END DO 1607 1647 1608 !print *, longi(10,10)1609 !print *, lati(10,10)1610 1611 1648 1612 1649 DO i = 1, west_east_dim … … 1624 1661 UUUmet(:,:,k) = VVV(:,:,k)*sin(alpha) + UUU(:,:,k)*cos(alpha) 1625 1662 VVVmet(:,:,k) = VVV(:,:,k)*cos(alpha) - UUU(:,:,k)*sin(alpha) 1626 !print *,UUU(10,10,k), UUUmet(10,10,k)1627 !print *,VVV(10,10,k), VVVmet(10,10,k)1628 1663 END DO 1629 1664 END IF -
trunk/MESOSCALE/LMD_MM_MARS/SRC/POSTPROC/comp_api
r114 r186 5 5 # 6 6 7 pgf90 api.F90 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include -Mfree -o api7 #pgf90 api.F90 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include -Mfree -o api 8 8 9 9 10 #g95 api.F90 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include -Wall -Wno=112,141,137,155 -fno-second-underscore -ffree-form -o api10 g95 api.F90 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include -Wall -Wno=112,141,137,155 -fno-second-underscore -ffree-form -o api 11 11 #g95 api.F90 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include -Wall -Wno=112,141,137,155 -ffree-form -o api 12 12 #pgf90 -mcmodel=medium -Mlarge_arrays api.F90 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include -Mfree -o p_interp -
trunk/MESOSCALE/LMD_MM_MARS/SRC/POSTPROC/namelist.api
r19 r186 1 1 &io 2 ! path_to_input = './dossier/ALT_POLAR_top0.1_sponge_smooth_topo/' !! ne doit pas etre trop long 3 ! path_to_output = './smooth' 4 path_to_input = './dossier/ALT_POLAR_top0.1_sponge/' 2 path_to_input = './' 5 3 path_to_output = './' 6 ! input_name = 'wrfout_d01_2024*' 7 input_name = 'wrfout_d01_2024-07-03_06:00:00' 8 ! path_to_input = './dossier_test/' 9 ! input_name = 'wrfout_d01_2024-01-05_02:00:00' 10 ! input_name = 'nca_wrfout_d01_2024-01-05_02:00:00' 4 input_name = 'wrfout_d01_9999-09-09_09:00:00' 11 5 process = 'list' !! list fields required in "fields" (available tk, tpot, GHT) 12 ! fields = 'W,SWDOWNZ,TAU_DUST,TSURF,XLONG,XLAT,HGT'13 ! fields = 'W'14 ! fields = 'U,V' !! beware, not only tk ! only one 3D field at least15 6 fields = 'tk,W,uvmet' 16 debug = .TRUE.17 7 / 18 process = 'all' !! process all fields in file19 debug = .TRUE.20 bit64 = .TRUE. ! bit64 = .TRUE. !! ne pas utiliser ?21 8 22 9 &interp_in 23 ! interp_levels = 1000.,987.5,975.,962.5,950.,937.5,925., 24 ! 900.,875.,850.,825.,800.,750.,700.,650., 25 ! 600.,550.,500.,450.,400.,350.,300.,250., 26 ! 225.,200.,175.,150.,137.5,125.,112.5,100., 27 ! 87.5,75.,62.5,50.,37.5,25.,12.5, 28 !interp_levels = 5., 4.9, 4.8, 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1, 4.0, 29 ! 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 30 ! 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0, 31 ! 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0, 32 ! 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 33 ! interp_levels = 5., 3., 1., 0.1 34 ! interp_method = 2, 35 interp_method = 3 !! INTERPOLATION: ALTITUDE ABOVE MOLA AREOID (km) 36 ! interp_method = 4 37 ! interp_levels = 20. 38 ! interp_levels = -09., -08., -07., -06., -05., -04., -03., -02., -01., 00., 39 ! 01., 02., 03., 04., 05., 06., 07., 08., 09., 40 ! interp_levels = 01., 02., 03., 04., 05., 06., 07., 08., 09., 41 ! 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 42 ! 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 43 !! 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 44 !! 40., 41., 42., 43., 44., 45., 46., 47., 48., 49. 45 ! interp_levels = 01., 01.5, 02., 02.5, 03., 03.5, 04., 04.5, 05., 05.5, 06., 06.5, 07., 07.5, 08., 08.5, 09., 09.5 46 ! 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5 47 ! 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5 48 interp_levels = 20.0 49 ! interp_levels = 01.00,01.25,01.50,01.75,02.00,02.25,02.50,02.75,03.00,03.25,03.50,03.75,04.00,04.25,04.50,04.75,05.00, 50 ! 05.25,05.50,05.75,06.00,06.25,06.50,06.75,07.00,07.25,07.50,07.75,08.00,08.25,08.50,08.75,09.00, 51 ! 09.25,09.50,09.75,10.00,10.25,10.50,10.75,11.00,11.25,11.50,11.75,12.00,12.25,12.50,12.75,13.00, 52 ! 13.25,13.50,13.75,14.00,14.25,14.50,14.75,15.00,15.25,15.50,15.75,16.00,16.25,16.50,16.75,17.00 53 ! interp_method = 2, 54 ! interp_levels = 1., 10 interp_method = 4 11 interp_levels = 0.050 55 12 / 56 extrapolate = 1,57 interp_method = 2,58 unstagger_grid = .TRUE. !! pb !! non c OK59 60 extrapolate = 0 ;; set values below ground and above model top to missing (default)61 extrapolate = 1 ;; extrapolate below ground, and set above model top to model top values62 interp_method = 1 ;; linear in p interpolation (default)63 interp_method = 2 ;; linear in log p interpolation
Note: See TracChangeset
for help on using the changeset viewer.