Skip to content

Commit 3f32c10

Browse files
committed
fixes from last pull request.
1 parent 5fd80eb commit 3f32c10

File tree

4 files changed

+25
-51
lines changed

4 files changed

+25
-51
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ all: ${MODULE}.so
1717
#Only really need first bit, if you change interface, but do it anyway so you don't forget.
1818
${MODULE}.so: pycrtm.f90
1919
f2py -m ${MODULE} -h sgnFile.pyf pycrtm.f90 --overwrite-signature
20-
${F2PY} ${F2PY_FLAGS}-c -L${LIB} -lcrtm -lgomp -I${INC} -m ${MODULE} $< only: wrap_forward wrap_k_matrix applyavg
20+
${F2PY} ${F2PY_FLAGS}-c -L${LIB} -lcrtm -lgomp -I${INC} -m ${MODULE} $< only: wrap_forward wrap_k_matrix
2121

2222
clean:
2323
${RM} ${MODULE}*.so

pycrtm.f90

+17-41
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ MODULE pycrtm
44

55
REAL(KIND=8), ALLOCATABLE :: aerosolEffectiveRadius(:,:,:) !(N_Profiles,N_layers, N_aerosols)
66
REAL(KIND=8), ALLOCATABLE :: aerosolConcentration(:,:,:) !(N_profiles,N_layers, N_aerosols)
7-
INTEGER, ALLOCATABLE :: aerosolType(:,:) !(N_Profiles, N_aerosols)
7+
INTEGER, ALLOCATABLE :: aerosolType(:,:) !(N_Profiles, N_aerosols)
88

99

1010
REAL(KIND=8), ALLOCATABLE :: cloudEffectiveRadius(:,:,:) !(N_Profiles,N_layers, N_clouds)
1111
REAL(KIND=8), ALLOCATABLE :: cloudConcentration(:,:,:) !(N_profiles,N_layers, N_clouds)
1212
REAL(KIND=8), ALLOCATABLE :: cloudFraction(:,:) !(N_profiles,N_layers)
13-
INTEGER, ALLOCATABLE :: cloudType(:,:) !(N_Profiles, N_clouds)
13+
INTEGER, ALLOCATABLE :: cloudType(:,:) !(N_Profiles, N_clouds)
1414

1515
REAL(KIND=8), ALLOCATABLE :: emissivityReflectivity(:,:,:) ! 2,N_profiles, nChan
1616

@@ -41,24 +41,24 @@ SUBROUTINE wrap_forward( coefficientPath, sensor_id_in, IRwaterCoeff_File, MWwat
4141
CHARACTER(len=*), INTENT(IN) :: sensor_id_in
4242
CHARACTER(len=*), INTENT(IN) :: IRwaterCoeff_File
4343
CHARACTER(len=*), INTENT(IN) :: MWwaterCoeff_File
44-
LOGICAL, INTENT(IN) :: output_tb_flag, output_transmission_flag, output_emissivity_flag
45-
LOGICAL, INTENT(IN) :: use_passed_emissivity
44+
LOGICAL, INTENT(IN) :: output_tb_flag, output_transmission_flag, output_emissivity_flag
45+
LOGICAL, INTENT(IN) :: use_passed_emissivity
4646
! The scan angle is based
4747
! on the default Re (earth radius) and h (satellite height)
48-
INTEGER, INTENT(IN) :: nChan, N_Profiles, N_Layers, N_trace
48+
INTEGER, INTENT(IN) :: nChan, N_Profiles, N_Layers, N_trace
4949
REAL(KIND=8), INTENT(IN) :: zenithAngle(n_profiles), scanAngle(n_profiles)
5050
REAL(KIND=8), INTENT(IN) :: azimuthAngle(n_profiles), solarAngle(n_profiles,2)
51-
INTEGER, INTENT(IN) :: year(n_profiles), month(n_profiles), day(n_profiles)
51+
INTEGER, INTENT(IN) :: year(n_profiles), month(n_profiles), day(n_profiles)
5252
REAL(KIND=8), INTENT(IN) :: pressureLevels(N_profiles, N_LAYERS+1)
5353
REAL(KIND=8), INTENT(IN) :: pressureLayers(N_profiles, N_LAYERS), temperatureLayers(N_Profiles,N_Layers)
5454
REAL(KIND=8), INTENT(IN) :: traceConcLayers(N_Profiles,N_layers,N_trace)
55-
INTEGER, INTENT(IN) :: trace_IDs(N_trace)
56-
INTEGER, INTENT(IN) :: climatology(N_profiles)
55+
INTEGER, INTENT(IN) :: trace_IDs(N_trace)
56+
INTEGER, INTENT(IN) :: climatology(N_profiles)
5757
REAL(KIND=8), INTENT(IN) :: surfaceTemperatures(N_Profiles,4), surfaceFractions(N_profiles, 4)
5858
REAL(KIND=8), INTENT(IN) :: LAI(N_Profiles), salinity(N_Profiles), windSpeed10m(N_Profiles), windDirection10m(N_Profiles)
59-
INTEGER, INTENT(IN) :: landType(N_Profiles), soilType(N_Profiles), vegType(N_Profiles), waterType(N_Profiles)
60-
INTEGER, INTENT(IN) :: snowType(N_Profiles), iceType(N_Profiles)
61-
INTEGER, INTENT(IN) :: nthreads
59+
INTEGER, INTENT(IN) :: landType(N_Profiles), soilType(N_Profiles), vegType(N_Profiles), waterType(N_Profiles)
60+
INTEGER, INTENT(IN) :: snowType(N_Profiles), iceType(N_Profiles)
61+
INTEGER, INTENT(IN) :: nthreads
6262
REAL(KIND=8), INTENT(OUT) :: outTb(N_Profiles,nChan)
6363
CHARACTER(len=256), DIMENSION(1) :: sensor_id
6464
! --------------------------
@@ -346,22 +346,22 @@ SUBROUTINE wrap_k_matrix( coefficientPath, sensor_id_in, IRwaterCoeff_File, MWwa
346346
! on the default Re (earth radius) and h (satellite height)
347347
REAL(KIND=8), INTENT(IN) :: zenithAngle(N_profiles), scanAngle(N_profiles)
348348
REAL(KIND=8), INTENT(IN) :: azimuthAngle(N_profiles), solarAngle(N_profiles,2)
349-
INTEGER, INTENT(IN) :: year(n_profiles), month(n_profiles), day(n_profiles)
349+
INTEGER, INTENT(IN) :: year(n_profiles), month(n_profiles), day(n_profiles)
350350
REAL(KIND=8), INTENT(IN) :: pressureLevels(N_profiles, N_Layers+1)
351351
REAL(KIND=8), INTENT(IN) :: pressureLayers(N_profiles, N_layers), temperatureLayers(N_profiles, N_layers)
352352
REAL(KIND=8), INTENT(IN) :: traceConcLayers(N_profiles, N_layers, N_trace)
353-
INTEGER, INTENT(IN) :: trace_IDs(N_trace)
354-
INTEGER, INTENT(IN) :: climatology(N_profiles)
353+
INTEGER, INTENT(IN) :: trace_IDs(N_trace)
354+
INTEGER, INTENT(IN) :: climatology(N_profiles)
355355
REAL(KIND=8), INTENT(IN) :: surfaceTemperatures(N_profiles,4), surfaceFractions(N_profiles,4), LAI(N_profiles)
356356
REAL(KIND=8), INTENT(IN) :: salinity(N_profiles), windSpeed10m(N_profiles), windDirection10m(N_profiles)
357-
INTEGER, INTENT(IN) :: landType(N_profiles), soilType(N_profiles), vegType(N_profiles), waterType(N_profiles)
358-
INTEGER, INTENT(IN) :: snowType(N_profiles), iceType(N_profiles)
357+
INTEGER, INTENT(IN) :: landType(N_profiles), soilType(N_profiles), vegType(N_profiles), waterType(N_profiles)
358+
INTEGER, INTENT(IN) :: snowType(N_profiles), iceType(N_profiles)
359359
REAL(KIND=8), INTENT(OUT) :: outTb(N_profiles,nChan)
360360
REAL(KIND=8), INTENT(OUT) :: skinK(N_profiles,nChan,4), emisK(N_profiles,nChan), reflK(N_profiles,nChan)
361361
REAL(KIND=8), INTENT(OUT) :: windSpeedK(N_profiles,nChan), windDirectionK(N_profiles,nChan)
362362
REAL(KIND=8), INTENT(OUT) :: temperatureJacobian(N_profiles, nChan, N_LAYERS)
363363
REAL(KIND=8), INTENT(OUT) :: traceJacobian(N_profiles, nChan, N_LAYERS, N_trace)
364-
INTEGER, INTENT(IN) :: nthreads
364+
INTEGER, INTENT(IN) :: nthreads
365365

366366
CHARACTER(len=256) :: sensor_id(1)
367367
! ============================================================================
@@ -675,30 +675,6 @@ SUBROUTINE check_and_allocate_globals(output_transmission_flag, N_Profiles, nCha
675675
END IF
676676
end SUBROUTINE check_and_allocate_globals
677677

678-
SUBROUTINE applyAvg( Ref_LnPressure, User_LnPressure, Nref, Nuser, Xin, Xout )
679-
USE ODPS_CoordinateMapping
680-
INTEGER, INTENT(IN) :: Nref, Nuser
681-
REAL(KIND=8), INTENT(IN) :: Ref_LnPressure(Nref)
682-
REAL(KIND=8), INTENT(IN) :: User_LnPressure(Nuser)
683-
REAL(KIND=8), INTENT(IN) :: Xin(Nuser)
684-
REAL(KIND=8), INTENT(OUT) :: Xout(Nref)
685-
!locals
686-
INTEGER :: k, interp_index(2,Nref)
687-
REAL(KIND=8) :: Acc_Weighting(Nuser,Nref)
688-
689-
!CALL LayerAvg( Ref_LnPressure , &
690-
! User_LnPressure , &
691-
! Acc_Weighting , &
692-
! interp_index)
693-
694-
695-
696-
DO k = 1, Nref
697-
Xout(k) = SUM(Acc_Weighting(interp_index(1,k):interp_index(2,k), k) &
698-
* Xin(interp_index(1,k):interp_index(2,k)) )
699-
END DO
700-
END SUBROUTINE applyAvg
701-
702678
SUBROUTINE aerosols_and_clouds_on(N_aerosols_crtm, N_clouds_crtm, aerosolsOn, cloudsOn)
703679

704680
INTEGER, INTENT(OUT) :: N_AEROSOLS_crtm, N_CLOUDS_crtm

setup_pycrtm.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ def patchCrtm(fo, fe, scriptDir, arch):
174174
p.wait()
175175
runAndCheckProcess(p,"Patching CRTM for gcc compatibility", fo, fe, scriptDir)
176176

177-
p = Popen(['patch','-p0','-i',os.path.join(scriptDir,'layerAvg.patch')],stderr=fe,stdout=fo)
178-
p.wait()
179-
runAndCheckProcess(p,"Patching CRTM for gcc compatibility", fo, fe, scriptDir)
177+
#p = Popen(['patch','-p0','-i',os.path.join(scriptDir,'layerAvg.patch')],stderr=fe,stdout=fo)
178+
#p.wait()
179+
#runAndCheckProcess(p,"Patching CRTM for gcc compatibility", fo, fe, scriptDir)
180180

181181
p = Popen(['patch','-p0','-i',os.path.join(scriptDir,'kmatrix.patch')],stderr=fe,stdout=fo)
182182
p.wait()

sourceMe.csh

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
module load other/comp/gcc-7.2
2-
source ~/bin/go3.csh
3-
setenv FORT gfortran
4-
setenv FCFLAGS '-fimplicit-none -ffree-form -fopenmp -fno-second-underscore -fPIC -frecord-marker=4 -std=f2008'
5-
setenv ILOC /discover/nobackup/bkarpowi/rt/crtm_2.3.0/
6-
setenv F2PY_COMPILER gnu95
1+
#module load comp/intel/19.1.0.166
2+
module load comp/gcc/9.2.0
3+
module load python/GEOSpyD/Ana2019.10_py3.7
4+

0 commit comments

Comments
 (0)