Error opening wrf netcdf file

Prezados, boa tarde.

Estou enfrentando um problema ao tentar executar o MCIP. O erro ocorre durante a sub-rotina SETUP e indica um problema ao abrir o arquivo NetCDF do WRF. O arquivo de log de erro retorna vazio. E a mensagem de erro exibida é a seguinte:

*** FILE = ./wrfout_d03_2016-04-01_00:00:00
*** NCF: NetCDF: Malformed URL

 *** ERROR ABORT in subroutine SETUP
 Date and time  0:00:00   April 1, 2016   (2016092:000000)

Já verifiquei o caminho e o nome do arquivo, e ambos estão corretos. O arquivo wrfout_d03_2016-04-01_00:00:00 existe no diretório especificado. E também já converti o arquivo wrfout_d03_2016-04-01_00:00:00 tanto para “netCDF classic format” quanto para " netCDF 64-bit format" (o erro permaneceu). Aqui estão algumas informações adicionais sobre o meu ambiente:

Versão do MCIP: 5.4
Versão do WRF: 4.4.2
Compilador: Intel Fortran Compiler
Bibliotecas: NetCDF 4.7.0, I/O API 3.2
Gostaria de saber se alguém já enfrentou esse problema e qual solução encontrou para esse tipo de erro.

Agradeço antecipadamente pela ajuda.

Please try to see if this command works:

ncdump -h wrfout_d03_2016-04-01_00:00:00

Ao executar o comando ncdump -h wrfout_d03_2016-04-01_00:00:00 segue abaixo um trecho do retorno:
:CEN_LAT = -12.64645f ;
:CEN_LON = -38.0794f ;
:TRUELAT1 = -12.957f ;
:TRUELAT2 = -12.957f ;
:MOAD_CEN_LAT = -12.795f ;
:STAND_LON = -38.121f ;
:POLE_LAT = 90.f ;
:POLE_LON = 0.f ;
:GMT = 0.f ;
:JULYR = 2016 ;
:JULDAY = 92 ;
:MAP_PROJ = 3 ;
:MAP_PROJ_CHAR = “Mercator” ;
:NUM_LAND_CAT = 21 ;
:ISWATER = 17 ;
:ISLAKE = 21 ;
:ISICE = 15 ;
:ISURBAN = 13 ;
:ETAC = 0.2f ;


I am sorry that I cannot answer you in Portuguese; I only speak and write in English. Hopefully, you can use either a person or a computer to translate my reply to you.

In your script, you need to make sure that you have the full Linux path set for “file_mm”. It appears that you do not have the location set correctly, even though the file is there.

If you are using the script for MCIP that is part of the release from GitHub (PREP/scripts/run_mcip.csh), please check to see that you have correctly set the variable “$InMetDir”. If you have modified the script, please ensure that you have the correct full paths (not just file names) for your WRF files in the script variable, “$InMetFiles”.

Hope this helps.

Hi @tlspero

Thanks for the guidance. I followed your instructions, ensuring the full Linux path is set to “file_mm” and verified that the file is present. However, the problem persists.

Here is the specific error message I receive:

*** FILE = ./wrfout_d03_2016-04-01_00:00:00
*** NCF: NetCDF: Malformed URL

 *** ABORT ERROR in SETUP subroutine

Date and time 0:00:00 April 1, 2016 (2016092:000000)
I also checked the “$InMetDir” variable and it is set correctly.

Below are the suggested and used adjustments:
file_mm = “/scratch/katty.santos/Simulations/CMAQ2/data/wrf/wrfout_d03_2016-04-01_00:00:00”
set CMAQ_HOME = /scratch/katty.santos/Simulations/CMAQ2 (run_mcip.csh)
setenv CMAQ_DATA $CMAQ_HOME/data (config_cmaq.csh)
set InMetDir = $DataPath/wrf (run_mcip.csh)
set InMetFiles = ( $InMetDir/wrfout_d03_2016-04-01_00:00:00 ) (run_mcip.csh)
Thank you for your assistance.


Could you please attach the file namelist.mcip? This file was likely created by your script, but you may have your script set up to read an existing file that you are modifying.

Thank you!

Oi @tlspero
Thanks for the feedback.
I attached the namelist.mcip file as requested

&FILENAMES.txt (716 Bytes)
Sorry @tlspero


Please check to see if your computing account has permission to read the input file, /scratch/katty.santos/Simulations/CMAQ2/data/wrf/wrfout_d03_2016-04-01_00:00:00.


@tlspero I have read and write permission
[katty.santos@login0 wrf]$ ls -l /scratch/katty.santos/Simulations/CMAQ2/data/wrf/wrfout_d03_2016-04-01_00:00:00
-rw-r–r-- 1 katty.santos katty.santos 33573902252 Jun 1 13:56 /scratch/katty.santos/Simulations/CMAQ2/data/wrf/wrfout_d03_2016-04-01_00:00:00


This is very helpful!

I believe that the error in MCIP occurs because the WRF file cannot be read. We have checked the script, the MCIP namelist file, and the permissions on your WRF file, and all of those seem fine. The error message from MCIP has the name of the WRF file incorrect (omitting the full path), and the error message from netCDF indicates that there is something wrong with the file.

I think your WRF file might be too big to be processed by netCDF. I think that the “ls” command (in your most recent post here) indicates that your WRF file is 33.6 gigabytes.

I do not know the length of your WRF simulation or the size of your domain, but (if the file size is too large, and if that is causing the error) I can help you reduce the WRF file size.

Please confirm that your file is indeed 33.6 gigabytes in size. If that is the case, then we can move to the next steps.


Hi @tlspero,
Follow the file size
-rw-r–r-- 1 katty.santos katty.santos 32G Jun 1 13:56 /scratch/katty.santos/Simulations/CMAQ2/data/wrf/wrfout_d03_2016-04-01_00:00:00


What version of netCDF, and compiled how? I regularly dealt with netCDF I/OAPI files of almost 700GB more than a decade ago (hydrology model, 33 years @ 6 hour timestep, 2500x3500x4 grid, re-starting the model every 7 days in order to assimilate lake-level data – over 1700 model runs used to construct this file… that was the reason for the I/O API 3.1 changes to deal with date/time overflows, to support time-keeping and files longer than 25.4 years.)

Unless you did something funky with the netCDF build, it’s not the file-size.


I think @cjcoats is correct that the size of your file is ok, so I am wrong about that hypothesis. (MCIP does not use I/O API to read WRF files, but netCDF is used.)

I wonder if you have “root” permissions on your machine and if you have been switching between “root” and your personal account to run MCIP. Something is still strange about passing the full path of your file into MCIP and the way the error message was formed.

I looked at your error message:
The full path of your file name is truncated to only the name of the WRF file, but “./” is appended before it. The namelist that you sent to me includes a full path, and I’m not sure what is causing that to happen. Please try to create a “soft link” (using the Linux command “ln -s”) to your WRF file in the directory where you are running MCIP. Where “file_mm” is set in your script, be sure to use the local soft link as the location instead of the full path (replace “/scratch/…wrfout…” with just “wrfout…”). Maybe there is a special character in your path that is not getting interpreted properly? (I am just guessing.)

@cjcoats – Do you have any other suggestions?

Please let me know if this helps.

Hi @cjcoats
Thank you for sharing your experience. I understand the challenge of dealing with large netCDF I/OAPI files and the modifications needed to avoid date/time overflows.
Regarding the version of netCDF used, the wrfout file is NetCDF-4. As for installation and compilation, I don’t have specific details,
because I do not have administrative privileges. The entire process of installing and compiling MCIP models is carried out by the HPC support team.
I noticed that the Netcdf variable in MCIP points to the use of netCDF classic. When I run a command to display it in the terminal, the command is executed but does not return any information.
I requested assistance from the HPC support team to obtain more details about this configuration and I am waiting for their response but in the meantime checking other possible causes.

Thank you very much for your help and for sharing these detailed suggestions.

Unfortunately, I don’t have “root” permissions on the machine and I don’t switch between “root” and my personal account to run MCIP. The entire installation and configuration process is done by the HPC support team.
I found your observation about the file path being truncated interesting. At the time of the initial error message displayed, I had run it as “./” because I moved the file into the folder. Then, someone suggested I try to run the file in another folder, setting the full path, hence the discrepancy in the namelist sent.
I’ll try to create a “soft link” to the WRF file in the directory where I’m running MCIP, as suggested.


Thank you for clarifying. I’m glad you don’t have “root” privileges here. I did not want you to have them. If you happened to be switching between your own account and “root”, then that might cause the problem. That removes another possible theory.

Please let me know what you find with the next test.


I followed your instructions to create a “soft link” and adjust the MCIP script to use that link instead of the full path. However, unfortunately I got the same error:


                       MCIP V5.4 FROZEN 07/12/2022


*** FILE = wrfout_d03
*** NCF: NetCDF: Malformed URL

 *** ERROR ABORT in subroutine SETUP
 Date and time  0:00:00   April 1, 2016   (2016092:000000)

I continue to investigate other possibilities and am open to more suggestions, @cjcoats and @tlspero. I really appreciate your patience and help.


Thank you for testing that. That is another good piece of information.

Out of curiosity, how many time periods are in your wrfout file? What is your output interval for WRF (hour, 30-minutes, something else)? How many grid cells (x,y,z) are in that file?


@tlspero Below is the requested information:

715 time periods.
Output interval is 1 hour.
The file has the following grid dimensions: (202, 202, 45).