Skip to content

Commit

Permalink
Update aircraft test, add Downwelling_Radiance test
Browse files Browse the repository at this point in the history
  • Loading branch information
chengdang committed Aug 15, 2024
1 parent feff9fb commit 475fb0a
Show file tree
Hide file tree
Showing 8 changed files with 964 additions and 9 deletions.
25 changes: 21 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ list( APPEND ClearSky_Sensor_Ids

# Create list of sensor ids for testing
list( APPEND AOD_Sensor_Ids
cris-fsr_n21
v.abi_g18
cris-fsr_n21
v.abi_g18
cris399_npp
v.abi_gr
abi_g18
abi_g18
airs_aqua
)

Expand All @@ -205,6 +205,18 @@ list( APPEND Aircraft_Sensor_Ids
crisB1_npp
)

list( APPEND Downwelling_Radiance_Sensor_Ids
atms_n21
cris-fsr_n21
v.abi_g18
atms_npp
cris399_npp
v.abi_gr
abi_g18
modis_aqua
)


list( APPEND OMPoverChannels_Sensor_Ids
atms_n21
)
Expand All @@ -216,8 +228,9 @@ list (APPEND common_tests
ChannelSubset
ClearSky
Aircraft
Downwelling_Radiance
ScatteringSwitch
User_Emissivity
User_Emissivity
SOI
SSU
VerticalCoordinates
Expand Down Expand Up @@ -406,6 +419,10 @@ foreach(regtype IN LISTS regression_types)
if (isregtype AND istesttype)
continue() #skip Aircraft type for k_Matrix
endif()
string(COMPARE EQUAL ${testtype} "Downwelling_Radiance" istesttype)
if (isregtype AND istesttype)
continue() #skip Downwelling_Radiance type for k_Matrix
endif()

add_executable(test_${regtype}_test_${testtype} mains/regression/${regtype}/test_${testtype}/test_${testtype}.f90)
target_link_libraries(test_${regtype}_test_${testtype} PRIVATE crtm)
Expand Down
10 changes: 5 additions & 5 deletions test/mains/regression/forward/test_Aircraft/test_Aircraft.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!
! test_Aircraft
!
! Test program for the aircraft instrument option under clear sky conditions
! Test program for the aircraft instrument option
!
!

Expand Down Expand Up @@ -31,8 +31,8 @@ PROGRAM test_Aircraft
INTEGER, PARAMETER :: N_PROFILES = 2
INTEGER, PARAMETER :: N_LAYERS = 92
INTEGER, PARAMETER :: N_ABSORBERS = 2
INTEGER, PARAMETER :: N_CLOUDS = 0
INTEGER, PARAMETER :: N_AEROSOLS = 0
INTEGER, PARAMETER :: N_CLOUDS = 1
INTEGER, PARAMETER :: N_AEROSOLS = 1
! ...but only ONE Sensor at a time
INTEGER, PARAMETER :: N_SENSORS = 1

Expand Down Expand Up @@ -105,8 +105,8 @@ PROGRAM test_Aircraft
Error_Status = CRTM_Init( (/Sensor_Id/), &
ChannelInfo, &
File_Path=COEFFICIENTS_PATH, &
Load_CloudCoeff = .FALSE., &
Load_AerosolCoeff = .FALSE.)
Load_CloudCoeff = .TRUE., &
Load_AerosolCoeff = .TRUE.)
IF ( Error_Status /= SUCCESS ) THEN
Message = 'Error initializing CRTM'
CALL Display_Message( PROGRAM_NAME, Message, FAILURE )
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
!
! Include file containing an internal subprogam to load some test surface data
!
SUBROUTINE Load_Sfc_Data()


! 4a.0 Surface type definitions for default SfcOptics definitions
! For IR and VIS, this is the NPOESS reflectivities.
! ---------------------------------------------------------------
INTEGER, PARAMETER :: TUNDRA_SURFACE_TYPE = 10 ! NPOESS Land surface type for IR/VIS Land SfcOptics
INTEGER, PARAMETER :: SCRUB_SURFACE_TYPE = 7 ! NPOESS Land surface type for IR/VIS Land SfcOptics
INTEGER, PARAMETER :: COARSE_SOIL_TYPE = 1 ! Soil type for MW land SfcOptics
INTEGER, PARAMETER :: GROUNDCOVER_VEGETATION_TYPE = 7 ! Vegetation type for MW Land SfcOptics
INTEGER, PARAMETER :: BARE_SOIL_VEGETATION_TYPE = 11 ! Vegetation type for MW Land SfcOptics
INTEGER, PARAMETER :: SEA_WATER_TYPE = 1 ! Water type for all SfcOptics
INTEGER, PARAMETER :: FRESH_SNOW_TYPE = 2 ! NPOESS Snow type for IR/VIS SfcOptics
INTEGER, PARAMETER :: FRESH_ICE_TYPE = 1 ! NPOESS Ice type for IR/VIS SfcOptics



! 4a.1 Profile #1
! ---------------
! ...Land surface characteristics
sfc(1)%Land_Coverage = 0.1_fp
sfc(1)%Land_Type = TUNDRA_SURFACE_TYPE
sfc(1)%Land_Temperature = 272.0_fp
sfc(1)%Lai = 0.17_fp
sfc(1)%Soil_Type = COARSE_SOIL_TYPE
sfc(1)%Vegetation_Type = GROUNDCOVER_VEGETATION_TYPE
! ...Water surface characteristics
sfc(1)%Water_Coverage = 0.5_fp
sfc(1)%Water_Type = SEA_WATER_TYPE
sfc(1)%Water_Temperature = 275.0_fp
! ...Snow coverage characteristics
sfc(1)%Snow_Coverage = 0.25_fp
sfc(1)%Snow_Type = FRESH_SNOW_TYPE
sfc(1)%Snow_Temperature = 265.0_fp
! ...Ice surface characteristics
sfc(1)%Ice_Coverage = 0.15_fp
sfc(1)%Ice_Type = FRESH_ICE_TYPE
sfc(1)%Ice_Temperature = 269.0_fp



! 4a.2 Profile #2
! ---------------
! Surface data
sfc(2)%Land_Coverage = 1.0_fp
sfc(2)%Land_Type = SCRUB_SURFACE_TYPE
sfc(2)%Land_Temperature = 318.0_fp
sfc(2)%Lai = 0.65_fp
sfc(2)%Soil_Type = COARSE_SOIL_TYPE
sfc(2)%Vegetation_Type = BARE_SOIL_VEGETATION_TYPE

END SUBROUTINE Load_Sfc_Data
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# @configure_input@

# individual test makefile template

# The file definitions. This include must occur before targets.
EXE_FILE=$(shell echo ${PWD} | sed 's,.*/,,')
SRC_FILE=$(EXE_FILE).f90
OBJ_FILE=${SRC_FILE:.f90=.o}

# The test type (e.g. forward, k_matrix, etc)
TEST_TYPE=`dirname ${PWD} | sed 's,.*/,,'`

# Tool-specific substitution variables
FC = @FC@
FCFLAGS = @FCFLAGS@ -I../../incsrc
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@

# The targets
all: $(EXE_FILE)

$(OBJ_FILE): $(SRC_FILE)

$(EXE_FILE): $(OBJ_FILE)
@echo; echo; \
echo "=============================================="; \
echo "Building $(TEST_TYPE) $(EXE_FILE) using:"; \
echo " FC : $(FC)"; \
echo " FCFLAGS : $(FCFLAGS)"; \
echo " LDFLAGS : $(LDFLAGS)"; \
echo "=============================================="
$(FC) $(LDFLAGS) $(OBJ_FILE) -o $(EXE_FILE) $(LIBS)

clean:
@echo; echo; \
echo "=============================================="; \
echo "Cleaning up $(TEST_TYPE) $(EXE_FILE)"; \
echo "=============================================="
rm -fr $(OBJ_FILE) $(EXE_FILE) gmon.out *.output *.bin results/*.signal

update:
@update() \
{ files=`find . -maxdepth 1 -name "$$1" -print`; \
if [ -n "$$files" ]; then \
mv $$files results; \
else \
echo "No $$1 files to update."; \
fi \
}; \
echo; echo; \
echo "=============================================="; \
echo "Updating results for $(TEST_TYPE) $(EXE_FILE)"; \
echo "=============================================="; \
update "*.output"; update "*.bin"

realclean: clean
-rm Makefile

# Specify targets that do not generate filesystem objects
.PHONY: all clean update realclean

# Specify suffix rules
.SUFFIXES: .f90 .o
.f90.o:
@$(FC) $(FCFLAGS) -c $<
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SUBROUTINE SignalFile_Create()
CHARACTER(256) :: Filename
INTEGER :: fid
Filename = RESULTS_PATH//TRIM(PROGRAM_NAME)//'_'//TRIM(Sensor_Id)//'.signal'
fid = Get_Lun()
OPEN( fid, FILE = Filename )
WRITE( fid,* ) TRIM(Filename)
CLOSE( fid )
END SUBROUTINE SignalFile_Create
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
crisB1_npp
Loading

0 comments on commit 475fb0a

Please sign in to comment.