RTTOV calculation weighting function displays an error

Satellite Application Facility for Numerical Weather Prediction Forums RTTOV RTTOV v14 RTTOV calculation weighting function displays an error

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #51589
    kunhan likunhan li
    Participant

    Dear Staff,

    Hello! I apologize for bothering you, but I have encountered a difficult problem while using RTTOV, so I have no choice but to seek your help. I want to use RTTOV to calculate the weighting functions for the GIIRS instrument on the Fengyun satellite. Therefore, I used the example_fwd.exe in the /bin directory. I ran this program in /bin using ./example_fwd.exe, and followed the on-screen instructions to input the satellite coefficient file and atmospheric profile data. However, after running, the program reported an error indicating that the type of the satellite coefficient file I entered does not exist, and the subsequent file path appeared as a garbled string. And after running it multiple times, each time the error string is random and not a fixed exception string. I do not know the cause of this. I have attached the full output of my run of example_fwd.exe below. Could you please tell me the reason for this? I look forward to your help.

    [likh@localhost bin]$ ./example_fwd.exe
    enter path of coefficient file
    /usr/package/rttov132/rtcoef_rttov13/rttov13pred101L/rtcoef_fy4_1_giirs_o3co2.dat
    enter path of file containing profile data
    /usr/package/rttov132/rttov_test/profile-datasets-hdf/standard101lev_co2o3.H5
    enter number of profiles
    1
    enter number of profile levels
    101
    turn on solar simulations? (0=no, 1=yes)
    0
    enter number of channels to simulate per profile
    1
    enter space-separated channel list
    1
    enter number of threads to use
    1
    2026/01/23 20:44:06 fatal error in module ../../src/coef_io/rttov_coef_io_mod.F90:0201
    File of filetype rtcoef does not exist:Ÿ���[�n � � +�n��� �� \�n���r/bin/ad8C�n#��p��dr2line �${�n��� ���[�n �¬�� x�*�n �� �� \�n ��
    2026/01/23 20:44:06 fatal error in module ../../src/coef_io/rttov_read_coefs.F90:0254

    fatal error reading coefficients
    STOP 1

    #51591
    James HockingJames Hocking
    Keymaster

    Hi,

    As described in section 5.3 of the RTTOV v13.2 user guide (see page 34 in particular), and as noted in the header of the example_fwd.F90 source code, it is strongly recommended to run the example_*.exe programs from the rttov_test/ folder using the corresponding run_example_*.sh shell script (e.g. run_example_fwd.sh) rather than calling the executables directly.

    In the first instance you should ensure that you can run the run_example_fwd.sh shell script supplied in the package without modification.

    You can then edit the shell script to run the example for GIIRS. Ensure that the filename is specified correctly. For example, be sure that the file extension is correct. You have specified an ASCII file (*.dat), but the RTTOV v13 hyperspectral coefficients are distributed as HDF (.H5) files.

    Example input files containing profile data can be found in the rttov_test/test_example.1/ folder. You cannot use the H5 profile data file you are passing without modifying the example_fwd.F90 code to read it. Indeed it is recommended that you examine the example_fwd.F90 code and modify it to suit your needs.

    Best wishes,
    James

    #51592
    kunhan likunhan li
    Participant

    Dear James,
    Thank you very much for your prompt and helpful reply!
    Following your advice, I have run the run_example_fwd.sh script from the rttov_test/ directory without any modifications, and the test completed successfully. This confirmed that my RTTOV installation and compilation (with HDF5 support enabled) are working correctly.
    I now plan to proceed by modifying the script to use my own coefficient file in HDF5 format (e.g., rtcoef_fy3_4_hiras_o3co2.H5) together with a profile file in ASCII (.dat) format, as recommended. I will ensure the file paths and formats are correctly specified in the script.
    Thanks again for your clear guidance—it has been extremely helpful in getting me on the right track. I truly appreciate your time and support.
    Should I encounter further issues during my experiments, I may need to reach out again. Please accept my apologies in advance for any future disturbances.
    Best wishes,
    Li

    #51594
    James HockingJames Hocking
    Keymaster

    Hi Li,

    That’s great – glad you were able to run the supplied script, and hopefully you can modify it successfully for your application.

    Feel free to contact us again if you encounter further issues.

    Best wishes,
    James

    #51595
    kunhan likunhan li
    Participant

    Dear James,

    I hope this message finds you well.

    Thank you very much for your previous valuable advice! Following your guidance, I have switched from directly invoking example_fwd.exe to using the run_example_fwd.sh script in the rttov_test/ directory for forward simulations. After confirming that the script works correctly with the default NOAA-19 AVHRR test case, I modified it to accommodate my own FY-4A GIIRS (or HIRAS) data as follows:

    1. Updated the coefficient filename to rtcoef_fy4_1_giirs_o3co2.H5 and adjusted the corresponding path;
    2. Set DO_SOLAR = 0, since GIIRS/HIRAS are infrared hyperspectral instruments without solar-reflective channels (I would appreciate confirmation if this setting is correct);
    3. Kept other parameters (e.g., NLEVELS=51, NCHAN=6) for initial testing.

    Upon running the modified script, a large amount of output was printed. I realized this was because I had left CHECK_REF=1, causing the script to compare my results against the official AVHRR reference output. The resulting diff clearly shows major differences—such as instrument type (giirs vs. avhrr), solar simulation status (F vs. T), and brightness temperature values—which is expected when comparing results from entirely different sensors.

    My main question is: Does the successful generation of an output file (despite the failed reference comparison) confirm that RTTOV has correctly computed the brightness temperatures and Jacobians (weighting functions) for GIIRS?
    Alternatively, does the output contain channel transmittances, from which weighting functions must be derived by taking derivatives with respect to pressure or temperature? These Jacobians are the core quantities I need for my research.

    Additionally, I encountered a practical issue regarding output file naming:
    I attempted to save results to a custom-named file by modifying the OUT_FILE variable in the script (e.g., output_example_fwd_fy41giirs.dat). However, the script failed with:
    `
    mv: cannot stat ‘output_example_fwd_fy41giirs.dat’: No such file or directory
    Expected output file not found
    `
    I suspect this occurs because example_fwd.exe always writes to the fixed filename output_example_fwd.dat, and the OUT_FILE variable in the script is only used for renaming and reference comparison—not for controlling the actual program output.

    Therefore, if I wish to generate results under a custom filename, do I need to modify the output filename directly in example_fwd.F90 and recompile RTTOV? Or is there a simpler workaround—such as post-processing via the shell script—to achieve this?

    Apologies for the many questions, and thank you again for your patience and invaluable support. I truly appreciate your time and expertise.

    Best regards,
    Li

    Below is all the output generated after running the program. In addition, I still don’t know what these characters, such as ‘2c2 or 34c34,39’, refer to. Could you explain it to me? I would be very grateful.

    [likh@localhost rttov_test]$ ./run_example_fwd.sh ARCH=gfortran

    Test forward

    Coef filename: rtcoef_fy4_1_giirs_o3co2.H5
    Input profile file: prof.dat
    Number of profiles: 1
    Number of levels: 51
    Do solar: 0
    Number of channels: 6
    Channel list: 1 2 3 4 5 6
    Number of threads: 1
    enter path of coefficient file
    enter path of file containing profile data
    enter number of profiles
    enter number of profile levels
    turn on solar simulations? (0=no, 1=yes)
    enter number of channels to simulate per profile
    enter space-separated channel list
    enter number of threads to use

    Output is in the file ./test_example.1/output_example_fwd.dat.gfortran
    — Diff file contents: —
    2c2
    < Instrument giirs

    > Instrument avhrr
    34c34,39
    < addsolar F

    > addsolar T
    > solar_sea_brdf_model 2
    > rayleigh_max_wavelength 2.0000
    > rayleigh_min_pressure 0.0000
    > rayleigh_single_scatt T
    > rayleigh_depol F
    153c158
    < CHANNELS PROCESSED FOR SAT fy4 1

    > CHANNELS PROCESSED FOR SAT noaa 19
    157c162,165
    < 221.86 224.22 222.71 222.24 223.99 221.23

    > 0.00 0.00 0.00 284.59 284.16 282.63
    >
    > CALCULATED SATELLITE REFLECTANCES (BRF):
    > 0.037 0.023 0.019 0.092 0.000 0.000
    160c168
    < 46.08 48.24 46.75 46.26 47.84 45.20

    > 0.54 0.37 0.27 0.33 87.51 100.83
    163c171
    < 46.08 48.24 46.75 46.26 47.84 45.20

    > 9.35 10.79 8.30 0.06 49.24 61.47
    166c174
    < 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000

    > 0.0000 0.0000 0.0000 0.8471 0.7753 0.6496
    169c177,180
    < 0.959 0.959 0.959 0.959 0.959 0.959

    > 0.000 0.000 0.000 0.975 0.991 0.985
    >
    > CALCULATED SURFACE BRDF:
    > 0.007 0.007 0.006 0.000 0.000 0.000
    174,223c185,234
    < 2 0.9988 0.9978 0.9984 0.9985 0.9979 0.9988
    < 3 0.9971 0.9956 0.9966 0.9967 0.9957 0.9974
    < 4 0.9941 0.9916 0.9932 0.9936 0.9918 0.9946
    < 5 0.9906 0.9868 0.9892 0.9900 0.9870 0.9913
    < 6 0.9855 0.9794 0.9831 0.9843 0.9799 0.9866
    < 7 0.9805 0.9721 0.9771 0.9788 0.9729 0.9821
    < 8 0.9745 0.9633 0.9700 0.9723 0.9644 0.9766
    < 9 0.9678 0.9534 0.9622 0.9650 0.9548 0.9705
    < 10 0.9596 0.9414 0.9526 0.9561 0.9431 0.9631
    < 11 0.9506 0.9281 0.9421 0.9462 0.9301 0.9549
    < 12 0.9413 0.9146 0.9314 0.9362 0.9169 0.9467
    < 13 0.9273 0.8944 0.9152 0.9211 0.8970 0.9342
    < 14 0.9023 0.8589 0.8866 0.8943 0.8621 0.9121
    < 15 0.8620 0.8034 0.8413 0.8514 0.8073 0.8763
    < 16 0.8061 0.7297 0.7797 0.7930 0.7353 0.8266
    < 17 0.7378 0.6438 0.7059 0.7232 0.6529 0.7657
    < 18 0.6578 0.5493 0.6215 0.6434 0.5632 0.6937
    < 19 0.5683 0.4515 0.5297 0.5558 0.4704 0.6115
    < 20 0.4731 0.3568 0.4352 0.4634 0.3792 0.5208
    < 21 0.3760 0.2697 0.3425 0.3690 0.2929 0.4243
    < 22 0.2814 0.1931 0.2556 0.2764 0.2144 0.3268
    < 23 0.1950 0.1288 0.1782 0.1916 0.1467 0.2347
    < 24 0.1215 0.0779 0.1129 0.1198 0.0919 0.1536
    < 25 0.0664 0.0417 0.0634 0.0662 0.0518 0.0899
    < 26 0.0308 0.0193 0.0305 0.0314 0.0255 0.0456
    < 27 0.0118 0.0075 0.0123 0.0126 0.0107 0.0197
    < 28 0.0036 0.0024 0.0039 0.0041 0.0038 0.0069
    < 29 0.0008 0.0007 0.0009 0.0011 0.0011 0.0019
    < 30 0.0001 0.0002 0.0001 0.0003 0.0002 0.0004
    < 31 0.0000 0.0001 0.0000 0.0001 0.0000 0.0000
    < 32 0.0000 0.0001 0.0000 0.0000 0.0000 0.0000
    < 33 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 34 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 35 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 36 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 37 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 38 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 39 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 40 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 41 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 42 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 43 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 44 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 45 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 46 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 47 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 48 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 49 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 50 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
    < 51 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000

    > 2 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
    > 3 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
    > 4 1.0000 0.9999 1.0000 1.0000 1.0000 1.0000
    > 5 0.9999 0.9999 1.0000 1.0000 1.0000 1.0000
    > 6 0.9999 0.9998 1.0000 1.0000 1.0000 1.0000
    > 7 0.9998 0.9998 1.0000 1.0000 1.0000 1.0000
    > 8 0.9997 0.9997 1.0000 1.0000 1.0000 1.0000
    > 9 0.9994 0.9997 0.9999 1.0000 0.9999 1.0000
    > 10 0.9993 0.9997 0.9999 1.0000 0.9999 0.9999
    > 11 0.9989 0.9996 0.9999 1.0000 0.9999 0.9999
    > 12 0.9986 0.9996 0.9999 0.9999 0.9999 0.9999
    > 13 0.9981 0.9995 0.9999 0.9999 0.9999 0.9999
    > 14 0.9970 0.9994 0.9998 0.9999 0.9998 0.9999
    > 15 0.9952 0.9992 0.9997 0.9998 0.9997 0.9998
    > 16 0.9930 0.9989 0.9996 0.9996 0.9996 0.9997
    > 17 0.9906 0.9987 0.9995 0.9994 0.9995 0.9996
    > 18 0.9882 0.9983 0.9994 0.9991 0.9993 0.9995
    > 19 0.9858 0.9980 0.9992 0.9987 0.9991 0.9994
    > 20 0.9833 0.9975 0.9990 0.9982 0.9988 0.9993
    > 21 0.9810 0.9971 0.9988 0.9976 0.9985 0.9991
    > 22 0.9789 0.9966 0.9985 0.9969 0.9983 0.9990
    > 23 0.9770 0.9960 0.9983 0.9961 0.9980 0.9989
    > 24 0.9752 0.9954 0.9980 0.9951 0.9978 0.9987
    > 25 0.9733 0.9947 0.9976 0.9939 0.9976 0.9985
    > 26 0.9715 0.9939 0.9972 0.9926 0.9973 0.9983
    > 27 0.9696 0.9931 0.9968 0.9911 0.9971 0.9981
    > 28 0.9677 0.9921 0.9963 0.9894 0.9968 0.9979
    > 29 0.9658 0.9911 0.9958 0.9876 0.9964 0.9976
    > 30 0.9638 0.9899 0.9952 0.9856 0.9961 0.9972
    > 31 0.9618 0.9886 0.9946 0.9835 0.9956 0.9968
    > 32 0.9598 0.9871 0.9940 0.9811 0.9951 0.9962
    > 33 0.9576 0.9853 0.9933 0.9786 0.9945 0.9954
    > 34 0.9554 0.9831 0.9925 0.9758 0.9937 0.9942
    > 35 0.9530 0.9805 0.9918 0.9725 0.9926 0.9923
    > 36 0.9506 0.9774 0.9910 0.9688 0.9911 0.9893
    > 37 0.9481 0.9736 0.9901 0.9642 0.9890 0.9850
    > 38 0.9454 0.9693 0.9892 0.9589 0.9861 0.9785
    > 39 0.9427 0.9643 0.9883 0.9526 0.9818 0.9697
    > 40 0.9399 0.9591 0.9873 0.9455 0.9762 0.9583
    > 41 0.9369 0.9530 0.9863 0.9370 0.9679 0.9422
    > 42 0.9338 0.9460 0.9851 0.9267 0.9547 0.9181
    > 43 0.9307 0.9387 0.9840 0.9154 0.9370 0.8877
    > 44 0.9276 0.9315 0.9829 0.9035 0.9153 0.8522
    > 45 0.9246 0.9245 0.9817 0.8912 0.8901 0.8128
    > 46 0.9217 0.9180 0.9806 0.8790 0.8625 0.7714
    > 47 0.9191 0.9120 0.9796 0.8671 0.8328 0.7284
    > 48 0.9170 0.9067 0.9787 0.8564 0.8034 0.6875
    > 49 0.9154 0.9027 0.9780 0.8478 0.7777 0.6527
    > 50 0.9138 0.8991 0.9773 0.8399 0.7535 0.6208
    > 51 0.9120 0.8952 0.9766 0.8314 0.7268 0.5865
    —————————

    #51597
    James HockingJames Hocking
    Keymaster

    Hi Li,

    I strongly recommend reading section 3 of the user as this explains some fundamental concepts in RTTOV. Please also read through the rttov-quick-start.pdf guide in the docs/ directory which provides a basic introduction to RTTOV with reference to the example_fwd.F90 code. I then also recommend reading through section 7 of the user guide which describes how to call RTTOV and provides a lot of guidance on how to use it for your own simulations. You can also read section 7 while referring to the relevant example_*.F90 source code. See also section 5.3 of the user guide which lists the other example_*.F90 programs available.

    The idea behind the included example_*.F90 Fortran programs and associated shell scripts is to illustrate clearly to users how to call RTTOV. It is expected that users will make significant modifications to these to suit their own needs. For example, you will need to set the relevant RTTOV options for your simulation, you will need to ingest your own profile and surface data, and you will need to modify the code to write the required outputs in a suitable file format for your application. For the input profile data, the examples are created to be human readable in order to help users understand how to use RTTOV. For a real-world application, there is no need to use the same ASCII format that the examples use and indeed it isn’t generally recommended.

    To answer your questions:

    1. HIRAS and GIIRS have some channels at wavenumbers greater than 2000 cm-1 (wavelengths shorter than 5 microns). If you enable solar radiation in the simulations then RTTOV will include solar radiation contributions in these channels. Whether you require this or not depends on your application. For current operational NWP applications, you probably do not require it, for example.

    2. If you set CHECK_REF=0 then the script will not carry out a diff to the test reference and will not print so much output to the terminal. This is certainly recommended when adapting the example code to your application, but as noted above, you are likely to want to make substantial changes to the Fortran code and shell script. If you look in the output file produced by the example, you should see reasonable (physically plausible) output values: these indicate that it ran successfully. The fact that it ran correctly without modifications means your RTTOV installation is working correctly.

    3. The name of the output file is hard-coded in the Fortran example: you need to change this and recompile if you want it to have a different name. But as noted above, you will need to make modifications to the Fortran anyway.

    4. If you require Jacobians, then I recommend starting from example_k.F90 which calls the RTTOV K (Jacobian) model rather than example_fwd.F90 which calls the forward (direct) model. The K model computes Jacobians for all relevant input profile variables (see section 7.9 of the user guide). If instead you require weighting functions (the derivative of transmittance with respect to pressure or other vertical coordinate) then you can edit the Fortran code to compute those from the direct model transmittance outputs. See the user guide to learn more about RTTOV outputs.

    Best wishes,
    James

    #51601
    kunhan likunhan li
    Participant

    Dear James,
    Hello!
    Thank you so much for taking the time amidst your busy schedule to provide such a detailed, clear, and highly instructive response to my questions. Your answers not only addressed each of my concerns precisely but also pointed me in the right direction for further learning and development—I truly appreciate it.
    I also sincerely apologize—my questions were indeed quite basic, perhaps even overly simple, and I’m sorry for taking up your valuable time. As a beginner with RTTOV, I’m still getting familiar with the example programs and core concepts. Going forward, I will make sure to study the documentation more thoroughly first, to avoid asking questions that could be resolved by reading the user guide. I will now carefully follow your advice and read the relevant sections of the user guide as suggested.
    Thank you again for your patience and support! Should I encounter difficulties in the future that I cannot resolve on my own, I may need to reach out for your guidance once more—I hope you won’t mind. Please accept my apologies in advance for any inconvenience.
    Wishing you all the best in your work and good health!
    Best wishes,
    Li

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.