THIS OPEN SOURCE AGREEMENT (“AGREEMENT”) DEFINES THE RIGHTS OF USE, REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT.
Government Agency: National Aeronautics and Space Administration
Government Agency Original Software Designation: LAR-18680
Government Agency Original Software Title: A Principal Component-based Method For Radiative Transfer Model (PCRTM- Shortwave version)
Government Agency Point of Contact for Original Software: Xu Liu [[email protected]]
- DEFINITIONS
A. “Contributor” means Government Agency, as the developer of the Original Software, and any entity that makes a Modification. B. “Covered Patents” mean patent claims licensable by a Contributor that are necessarily infringed by the use or sale of its Modification alone or when combined with the Subject Software. C. “Display” means the showing of a copy of the Subject Software, either directly or by means of an image, or any other device. D. “Distribution” means conveyance or transfer of the Subject Software, regardless of means, to another. E. “Larger Work” means computer software that combines Subject Software, or portions thereof, with software separate from the Subject Software that is not governed by the terms of this Agreement. F. “Modification” means any alteration of, including addition to or deletion from, the substance or structure of either the Original Software or Subject Software, and includes derivative works, as that term is defined in the Copyright Statute, 17 USC 101. However, the act of including Subject Software as part of a Larger Work does not in and of itself constitute a Modification. G. “Original Software” means the computer software first released under this Agreement by Government Agency with Government Agency designation LAR-18680 and entitled A Principal Component-based Method For Radiative Transfer Model (PCRTM-Shortwave version), including source code, object code and accompanying documentation, if any. H. “Recipient” means anyone who acquires the Subject Software under this Agreement, including all Contributors. I. “Redistribution” means Distribution of the Subject Software after a Modification has been made. J. “Reproduction” means the making of a counterpart, image or copy of the Subject Software. K. “Sale” means the exchange of the Subject Software for money or equivalent value. L. “Subject Software” means the Original Software, Modifications, or any respective parts thereof. M. “Use” means the application or employment of the Subject Software for any purpose.
- GRANT OF RIGHTS
A. Under Non-Patent Rights: Subject to the terms and conditions of this Agreement, each Contributor, with respect to its own contribution to the Subject Software, hereby grants to each Recipient a non-exclusive, world-wide, royalty-free license to engage in the following activities pertaining to the Subject Software:
- Use
- Distribution
- Reproduction
- Modification
- Redistribution
- Display
B. Under Patent Rights: Subject to the terms and conditions of this Agreement, each Contributor, with respect to its own contribution to the Subject Software, hereby grants to each Recipient under Covered Patents a non-exclusive, world-wide, royalty-free license to engage in the following activities pertaining to the Subject Software:
- Use
- Distribution
- Reproduction
- Sale
- Offer for Sale
C. The rights granted under Paragraph B. also apply to the combination of a Contributor’s Modification and the Subject Software if, at the time the Modification is added by the Contributor, the addition of such Modification causes the combination to be covered by the Covered Patents. It does not apply to any other combinations that include a Modification.
D. The rights granted in Paragraphs A. and B. allow the Recipient to sublicense those same rights. Such sublicense must be under the same terms and conditions of this Agreement.
- OBLIGATIONS OF RECIPIENT
A. Distribution or Redistribution of the Subject Software must be made under this Agreement except for additions covered under paragraph 3H.
- Whenever a Recipient distributes or redistributes the Subject Software, a copy of this Agreement must be included with each copy of the Subject Software; and
- If Recipient distributes or redistributes the Subject Software in any form other than source code, Recipient must also make the source code freely available, and must provide with each copy of the Subject Software information on how to obtain the source code in a reasonable manner on or through a medium customarily used for software exchange.
B. Each Recipient must ensure that the following copyright notice appears prominently in the Subject Software:
This software may be used, reproduced, and provided to others only as permitted under the terms of the agreement under which it was acquired from the U.S. Government. Neither title to, nor ownership of, the software is hereby transferred. This notice shall remain on all copies of the software
Copyright 2015 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved.
C. Each Contributor must characterize its alteration of the Subject Software as a Modification and must identify itself as the originator of its Modification in a manner that reasonably allows subsequent Recipients to identify the originator of the Modification. In fulfillment of these requirements, Contributor must include a file (e.g., a change log file) that describes the alterations made and the date of the alterations, identifies Contributor as originator of the alterations, and consents to characterization of the alterations as a Modification, for example, by including a statement that the Modification is derived, directly or indirectly, from Original Software provided by Government Agency. Once consent is granted, it may not thereafter be revoked.
D. A Contributor may add its own copyright notice to the Subject Software. Once a copyright notice has been added to the Subject Software, a Recipient may not remove it without the express permission of the Contributor who added the notice.
E. A Recipient may not make any representation in the Subject Software or in any promotional, advertising or other material that may be construed as an endorsement by Government Agency or by any prior Recipient of any product or service provided by Recipient, or that may seek to obtain commercial advantage by the fact of Government Agency's or a prior Recipient’s participation in this Agreement.
F. In an effort to track usage and maintain accurate records of the Subject Software, each Recipient, upon receipt of the Subject Software, is requested to provide Government Agency, by e-mail to the Government Agency Point of Contact listed in clause 5.F., the following information: First and Last Name; Email Address; and Affiliation. Recipient’s name and personal information shall be used for statistical purposes only. Once a Recipient makes a Modification available, it is requested that the Recipient inform Government Agency, by e-mail to the Government Agency Point of Contact listed in clause 5.F., how to access the Modification.
G. Each Contributor represents that that its Modification is believed to be Contributor’s original creation and does not violate any existing agreements, regulations, statutes or rules, and further that Contributor has sufficient rights to grant the rights conveyed by this Agreement.
H. A Recipient may choose to offer, and to charge a fee for, warranty, support, indemnity and/or liability obligations to one or more other Recipients of the Subject Software. A Recipient may do so, however, only on its own behalf and not on behalf of Government Agency or any other Recipient. Such a Recipient must make it absolutely clear that any such warranty, support, indemnity and/or liability obligation is offered by that Recipient alone. Further, such Recipient agrees to indemnify Government Agency and every other Recipient for any liability incurred by them as a result of warranty, support, indemnity and/or liability offered by such Recipient.
I. A Recipient may create a Larger Work by combining Subject Software with separate software not governed by the terms of this agreement and distribute the Larger Work as a single product. In such case, the Recipient must make sure Subject Software, or portions thereof, included in the Larger Work is subject to this Agreement.
J. Notwithstanding any provisions contained herein, Recipient is hereby put on notice that export of any goods or technical data from the United States may require some form of export license from the U.S. Government. Failure to obtain necessary export licenses may result in criminal liability under U.S. laws. Government Agency neither represents that a license shall not be required nor that, if required, it shall be issued. Nothing granted herein provides any such export license.
- DISCLAIMER OF WARRANTIES AND LIABILITIES; WAIVER AND INDEMNIFICATION
A. No Warranty: THE SUBJECT SOFTWARE IS PROVIDED “AS IS” WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT “AS IS.”
B. Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.
- GENERAL TERMS
A. Termination: This Agreement and the rights granted hereunder will terminate automatically if a Recipient fails to comply with these terms and conditions, and fails to cure such noncompliance within thirty (30) days of becoming aware of such noncompliance. Upon termination, a Recipient agrees to immediately cease use and distribution of the Subject Software. All sublicenses to the Subject Software properly granted by the breaching Recipient shall survive any such termination of this Agreement.
B. Severability: If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement.
C. Applicable Law: This Agreement shall be subject to United States federal law only for all purposes, including, but not limited to, determining the validity of this Agreement, the meaning of its provisions and the rights, obligations and remedies of the parties.
D. Entire Understanding: This Agreement constitutes the entire understanding and agreement of the parties relating to release of the Subject Software and may not be superseded, modified or amended except by further written agreement duly executed by the parties.
E. Binding Authority: By accepting and using the Subject Software under this Agreement, a Recipient affirms its authority to bind the Recipient to all terms and conditions of this Agreement and that that Recipient hereby agrees to all terms and conditions herein.
F. Point of Contact: Any Recipient contact with Government Agency is to be directed to the designated representative as follows:
Barbara “Bonnie” Lumanog Software Release Authority MS 158, NASA Langley Research Center Hampton, VA 23681 Fax: 757-864-6500 Phone: 757-864-2933 Email: [email protected]
INSTRUCTION FOR PCRTM INSTALLATION AND RUNNING SAMPLE FORWARD SIMULATION CODE [[email protected]]
1a). Click ‘Download Zip’ from webpage ‘https://github.com/PCRTM/INPUTDIR’ to download database files.
1b). Unzip INPUTDIR-master.zip under your designated directory, change the directory name to be ‘INPURDIR’
2a). Click ‘Download Zip’ from webpage ‘https://github.com/PCRTM/IGENERIC’ to download source code files.
2b). Unzip GENERIC-master.zip under your designated directory, change the directory name to be ‘GENERIC’
3). cd to GENERIC directory
4). Make (default compiler ifort) You do not need to edit Makefile if you want to switch to ifort debugging mode or gfortran compiler, simply type make intel_debug, make gfortran, make gfortran_debug to use those optional modes
5). make install
6a). Click ‘Download Zip’ from webpage ‘https://github.com/PCRTM/User_code’ to download user sample files.
6b). Unzip User_code-master.zip under your designated directory, change the directory name to be ‘User_code’.
7). cd ../User_code
8). make to generate executable file ‘FWD_simu_sample.exe’. You need to edit Makefile to choose your fortran compiler.
FWD_simu_sample.exe expects to load databases from the ‘INPUTDIR’ and read a namelist file "pcrtm.in". You can softlink INPUTDIR to the directory where FWD_simu_sample.exe is located The format of pcrtm.in is as follow:
$InputPar sensor_id = 26
molindx = 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1
scalfac = 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
jacob = .false.
chdomain = .true.
jacob_ch = .false. % Jacobian in channel domain
BT_FLAG = .false. % Brightness temperature
JACOB_BT = .false. % Jacobian in Brightness temperature
TR_FLAG = .false. % flag for channel transmittance calculation
/
Sensor_id and corresponding instrument
26--- IASI 0.25 cm-1 spectral resolution full channel set
27--- AIRS
28--- high resolution CrIS (Blackman apodization function)
29--- high resolution CrIS (Boxcar apodization function)
30--- high resolution CrIS (Hamming apodization function)
31--- NAST-I (Boxcar apodization function)
32--- NAST-I (Kaiser apodization function)
33--- SHIS (Boxcar apodization function)
34--- SHIS (Kaiser apodization function)
35--- CrIS (Boxcar apodization function)
36--- CrIS (Hamming apodization function)
37--- CrIS (Blackman apodization function)
- absorption coefficient datasets associated with senor id 26-37 are obtained using lblrtm v-12.2. Those datasets can be used for the RT calculation in the atmosphere with the simulation for the absorption of 15 trace gases being included. Solar radiation contribution simulation function for those sensor ids is provided.
** To switch from one sensor to another, simple change the sensor_id number in 'pcrtm.in'. For airborne instrument like NAST-I and SHIS, forward simulation for unrealistic situation (e.g. observation height above 100 hPc) will not result in warning message, but the results are not reliable. You might want to consider setting the “Geometry%pobs” to be realistic aircraft pressure level in the example pcrtm driver code "FWD_simu_sample.f90”.
** molindx can be set to 0, 1, or 2 for each of the 15 trace gases (H2O, CO2, O3, N2O, CO, CH4, OO2 ,NO1, SO2,NO2, NH3,NO3,Cl4,F11,F12). when molindx =0, the corresponding trace gas absorption (emission) will be treated as fixed gas and the US standard atmosphere will be used as the default profile. When molindx =1, the corresponding trace gas absorption (emission) will be treated as a variable gas and the US standard atmosphere will be used as the default profile. When molindx =2, the corresponding trace gas absorption (emission) will be treated as a variable gas and the user has to provide an atmospheric profile.
** scalfac is a scaling factor used to scale the standard or user provided atmospheric profiles
** jacob is a logical variable used to determine if jacobian will be calculated or not
chdomain is a logical variable used to determine if the channel radiances will be calculated or not.
** jacob_ch is a logical variable used to determine if channel jacobian will be calculated or not.
** BT_FLAG is a logical variable used to determine if brightness temperature will be calculated or not.
** JACOB_BT is a logical variable used to determine if Jacobian associated with brightness temperature will be calculated or not (both Jacob and jacob_ch need to be set as 'true' ).
** TR_FLAG is a logical variable used to determine if transmittance in channel domain will be calculated or not.
** Users need to provide surface emissivity specified in the mono frequency domain by assigning and modifying the “RT_solution” structure:
RT_solution%emis = ..............................
where dimension of the mono frequency domain is specified by the “PCRTM_stnd” structure of each sensor. The mono frequency bins are specified by “PCRTM_stnd%frq”.
Output in either Principal Component (PC) domain or channel domains are included in the “EOF_solution” structure. Calculated Jacobians are included in the “K_ch” (in channel domain) and “K_pc” (in PC domain) structures.
IMPORTANT VARIABLES ASSOCIATED WITH KEY STRUCTURES
1. Geometry – the structure which includes information for the surface pressure, observation height and satellite zenith angle.
Type PCRTM_GEOMETRY_TYPE
real(single) :: psfc ! surface pressure
real(single) :: pobs ! atmosphere pressure at the observation altitude
................
real(single) :: seczang ! sec value of satellite zenith angle
real(single) :: satang ! satellite zenith angle
End type PCRTM_GEOMETRY_TYPE
2. Atm -- Atmosphere structure defined in PCRTM model
TYPE PCRTM_ATMOSPHERE_TYPE
REAL, ALLOCATABLE :: Tlev(:) ! Tlevels(nLev)
REAL, ALLOCATABLE :: VMR(:,:) ! VMR(nLev,nMol)
REAL, ALLOCATABLE :: Tlay(:) ! Tlay(nlay)
REAL, ALLOCATABLE :: GasProf(:,:) ! GasProf(nLay,nMol)
REAL, ALLOCATABLE :: Airamt(:) ! AirAmt(nlay)
REAL, ALLOCATABLE :: dlaydlev(:) ! dlaydlev(nlev)
REAL, ALLOCATABLE :: cld_flag(:)
! cloud flag for each layer 0 -clear 1 - ice 2 – water ! cloud parameter associated with each layer REAL, ALLOCATABLE :: pcld(:) ! cloud height REAL, ALLOCATABLE :: taucld(:) ! cloud visible optical depth REAL, ALLOCATABLE :: decld(:) ! cloud particle size REAL :: tskin ! skin temperature END TYPE PCRTM_ATMOSPHERE_TYPE
3. EOF_solution -- the structure which defines the radiance solution in channel domain and EOF domain
Type PCRTM_EOF_solution_type
logical :: chdomain !determine if channel radiance will be calculated
integer :: nReg !No. of Mono frq in each band
integer :: nchbnd !No. of chan frq in each band
integer :: nPcbnd !No. of EOFs in each band
............................
real(double), allocatable :: frqM(:) !Mono frq
real(double), allocatable :: frqCh(:) !channel frq
real(single), allocatable :: Pc(:,:) !Principal Components for each bands
real(single), allocatable :: RadStdCh(:) !normalization factor
real(single), allocatable :: RadMeanCh(:) !mean channel radiance
..............................................
real(single), allocatable :: Radch(:) !Radiance in channel domain
real(single), allocatable :: Radpc(:) !Radiance in EOF domain
End type PCRTM_EOF_solution_type
4. K_pc -- Jacobian in EOF domain
Type PCRTM_PC_Jacobian_type
logical :: jacob_pc ! determine if PC Jacobian will be calculated
! Jacobian - PC scores / atmospheric level quantity (npc, nlev)
real(single), allocatable :: K_t(:,:),K_TLAY(:,:),K_EM(:), K_TS(:)
REAL(SINGLE), ALLOCATABLE :: K_gaslev(:,:,:),K_gaslay(:,:,:)
End type PCRTM_PC_Jacobian_type
5. K_ch -- Jacobian in channel domain
Type PCRTM_ch_Jacobian_type
logical :: jacob_ch ! determine if channel Jacobian will be calculated
real(single), allocatable :: R_tlev(:,:) ! Temperature Jacobian in channel domain
real(single), allocatable :: R_gaslev(:,:,:) ! Jacobian for trace gases and humidity
real(single), allocatable :: R_em(:), R_ts(:) ! Jacobian for emissivity and skin temperature
End type PCRTM_ch_Jacobian_type
*R_gaslev includes the Jacobian for all trace gases and humidity. Current version includes the calculation for:
R_gaslev(1:nch, 1:nlev, 1) -- water
R_gaslev(1:nch, 1:nlev, 2) -- CO2
R_gaslev(1:nch, 1:nlev, 3) -- O3
R_gaslev(1:nch, 1:nlev, 4) -- N2O
R_gaslev(1:nch, 1:nlev, 5) -- CO
R_gaslev(1:nch, 1:nlev, 6) -- CH4
R_gaslev(1:nch, 1:nlev, 7) -- OO2
R_gaslev(1:nch, 1:nlev, 8) -- NO1
R_gaslev(1:nch, 1:nlev, 9) -- SO2
R_gaslev(1:nch, 1:nlev, 10) -- NO2
R_gaslev(1:nch, 1:nlev, 11) -- NH3
R_gaslev(1:nch, 1:nlev, 12) -- HNO3
R_gaslev(1:nch, 1:nlev, 13) -- Cl4
R_gaslev(1:nch, 1:nlev, 14) -- F11
R_gaslev(1:nch, 1:nlev, 15) -- F12