<div dir="ltr">Full credit to Dominikus Heinzeller for helping me compile WPS on CYGWIN. His solution to my problem worked very well indeed and generates ungrib.exe(the last executable needed for starting simulations)<div>
<br></div><div>His solution is to add -traditional to the CPP variable and that resolves all the compiler problems.</div><div><br></div><div><br></div><div><div>CPP = /lib/cpp -C -P -traditional</div></div>
<div><br></div><div>Grateful to Dominikus again,</div><div>Regards,<br>Ashwin. </div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 10:09 PM, Dominikus Heinzeller <span dir="ltr"><<a href="mailto:xena.the.fire.goddess@googlemail.com" target="_blank">xena.the.fire.goddess@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>You are telling gfortran to use the strict “fixed-form”, i.e., the old Fortran77 format (first six characters for label/goto statements etc, a relic from the good old punchcard times). Remove the “-ffixed-form”, gfortran will then assume “-ffree-form” code (default for .f90 files).</div>
<div><br></div><div>Cheers</div><div><br></div><div>Dom</div><div><br></div><div><div><div class="h5"><div>On 20/07/2014, at 2:28 pm, ashwinD12 . <<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr">Got past these errors with some help. Only few questions remain <div><br></div><div>I get these errors with rd_grib2.f90 - </div><div><br></div><div>
<div>gfortran -c -ffixed-form -O -fdollar-ok -fconvert=big-endian -frecord-marker=4 rd_grib2.f90 -I. -I./ngl/g2</div>
<div>rd_grib2.f90:179.5:</div><div><br></div><div> else </div><div> 1</div><div>Error: Non-numeric character in statement label at (1)</div><div>rd_grib2.f90:179.5:</div>
<div><br></div><div> else </div><div> 1</div><div>Error: Unclassifiable statement at (1)</div><div>rd_grib2.f90:189.5:</div><div><br></div><div> endif </div>
<div> 1</div><div>Error: Non-numeric character in statement label at (1)</div><div>rd_grib2.f90:189.5:</div><div><br></div><div> endif </div><div> 1</div>
<div>Error: Unclassifiable statement at (1)</div><div>rd_grib2.f90:611.4:</div><div><br></div><div> if (gfld%ipdtmpl(12) .eq. 2. .or. </div><div> 1</div><div>Error: Non-numeric character in statement label at (1)</div>
<div>rd_grib2.f90:611.4:</div><div><br></div><div> if (gfld%ipdtmpl(12) .eq. 2. .or. </div><div> 1</div><div>Error: Unclassifiable statement at (1)</div><div>rd_grib2.f90:614.4:</div>
<div><br></div><div> else </div><div> 1</div><div>Error: Non-numeric character in statement label at (1)</div><div>rd_grib2.f90:614.4:</div><div><br></div>
<div> else </div><div> 1</div><div>Error: Unclassifiable statement at (1)</div><div>rd_grib2.f90:616.4:</div><div><br></div><div> endif </div>
<div> 1</div><div>Error: Non-numeric character in statement label at (1)</div><div>rd_grib2.f90:616.4:</div><div><br></div><div> endif </div><div> 1</div>
<div>Error: Unclassifiable statement at (1)</div><div>rd_grib2.f90:682.9:</div><div><br></div><div> enddo VERSION ! skgb </div><div> 1</div><div>Error: Expecting END IF statement at (1)</div>
<div>rd_grib2.f90:696.9:</div><div><br></div><div> END subroutine rd_grib2 </div><div> 1</div><div>Error: Expecting END DO statement at (1)</div><div>rd_grib2.f90:727.6:</div>
<div><br></div><div> SUBROUTINE edition_num(junit, gribflnm, </div><div> 1</div><div>Error: Unclassifiable statement at (1)</div><div>rd_grib2.f90:729.72:</div><div><br></div><div> use grib_mod </div>
<div> 1</div><div>Error: Unexpected USE statement at (1)</div><div>rd_grib2.f90:730.72:</div><div><br></div><div> use params </div>
<div> 1</div><div>Error: Unexpected USE statement at (1)</div><div>rd_grib2.f90:731.72:</div><div><br></div><div> use module_debug </div>
<div> 1</div><div>Error: Unexpected USE statement at (1)</div><div>rd_grib2.f90:732.26:</div></div><div><br></div><div><br></div><div><br></div><div>
Should I download the latest version of rd_grib2.f90 and recompile ? It appears this file is being compiled in fixed format.</div>
<div><br></div><div>2) Second question is the NCARG_LIBS2 variable in configure.defaults which is commented out for CYGWIN</div><div><br></div><div><div>#NCARG_LIBS2 = -L${PGI}/linux86/6.1/lib -lpgftnrtl -lpgc \</div>
<div># -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.3 -lg2c</div></div><div><br></div><div><br></div><div>Anyone have any idea what should be supplied here ?</div><div><br></div><div>3) I presume again that although the grib2 option has not been specified for CYGWIN in configure.defaults I must go ahead and add the required changes for the following 2 variables -</div>
<div>WRF_LIB WRF_INCLUDE. </div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 17, 2014 at 6:18 PM, ashwinD12 . <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">In WPS/ungrib/src/ngl/g2 there is a Makefile that contains the following segment <div><br></div><div>.F.o:</div>
<div> $(CPP) $(FDEFS) $*.F > $*.f90</div><div> $(FC) -c $(F77FLAGS) $*.f90</div>
<div> /bin/rm -f $*.f90.</div><div><br></div><div>Is this not a bug ? Because if I have fixed form with .f90 files the & symbol in addfield.f90 will not compile. </div><div><br></div><div>Should this not be FFLAGS ? I can go ahead and compile my code but I just want to know what the other users on this list think. </div>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 16, 2014 at 7:51 PM, ashwinD12 . <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Since WRF 3.6 compiled correctly why do I get these linking errors in WPS 's geogrid.exe -<div><br>
</div>
<div><div style="font-family:arial,sans-serif;font-size:13px"><div>SUFFIXES: .F .f .c .o</div><div>
<br></div><div>SHELL = /bin/sh</div><div><br></div><div>NCARG_LIBS = -L$(NCARG_ROOT)/lib -lncarg -lncarg_gks -lncarg_</div><div>c \</div><div> -L/usr/X11R6/lib -lX11</div>
<div><br></div><div>NCARG_LIBS2 = # May be overridden by architecture specific val</div><div>ue below</div><div><br></div><div>FDEFS = -DUSE_JPEG2000 -DUSE_PNG</div><div><br></div>
<div># Listing of options that are usually independent of machine type.</div><div># When necessary, these are over-ridden by each architecture.</div><div><br></div><div>ARFLAGS =</div><div><br></div><div>
PERL = perl</div>
<div><br></div><div>RANLIB = echo</div><div><br></div><div>COMPILING_ON_CYGWIN_NT = yes</div><div><br></div><div>WRF_INCLUDE = -I$(WRF_DIR)/external/io_netcdf \</div><div> -I$(WRF_DIR)/external/io_grib_share \</div>
<div> -I$(WRF_DIR)/external/io_grib1 \</div><div> -I$(WRF_DIR)/external/io_int \</div><div> -I$(WRF_DIR)/inc \</div><div> -I$(NETCDF)/include</div>
<div><br></div><div>WRF_LIB = -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \</div><div> -L$(WRF_DIR)/external/io_grib_share -lio_grib_share \</div><div> -L$(WRF_DIR)/external/io_int -lwrfio_int \</div>
<div> -L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \</div><div> -L$(NETCDF)/lib -lnetcdff -lnetcdf</div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">
<div><br></div><div>COMPRESSION_LIBS = # intentionally left blank, fill in COMPRESSION_LIBS </div><div>below</div><div><br></div><div>COMPRESSION_INC = # intentionally left blank, fill in COMPRESSION_INC b</div>
<div>elow</div><div><br></div><div>#</div><div># Settings for CYGWIN_NT i686 x86_64 PGI compiler on Windows (serial) </div><div>#</div><div>#</div><div>COMPRESSION_LIBS = -L/usr/local/lib -ljasper -lpng -lz</div>
<div>
COMPRESSION_INC = -I/usr/local/include/jasper</div><div>FDEFS = -DUSE_JPEG2000 -DUSE_PNG</div><div>#NCARG_LIBS2 = -L${PGI}/linux86/6.1/lib -lpgftnrtl -lpgc \</div><div># -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.3 -lg2c</div>
<div>WRF_LIB = $(WRF_DIR)/external/io_grib1/libio_grib1.a \</div><div> $(WRF_DIR)/external/io_grib_share/libio_grib_share.a \</div><div> $(WRF_DIR)/external/io_int/libwrfio_int.a \</div>
<div> $(WRF_DIR)/external/io_netcdf/libwrfio_nf.a \</div><div> $(NETCDF)/lib/libnetcdf.a \</div><div> $(NETCDF)/lib/libnetcdff.a</div><div>
SFC = gfortran</div>
<div>SCC = gcc</div><div>DM_FC = mpif90 -f90=$(SFC)</div><div>DM_CC = mpicc -cc=$(SCC)</div><div>FC = $(SFC)</div><div>CC = $(SCC)</div><div>
LD = $(SFC)</div>
<div>FFLAGS = -ffree-form -ffree-line-length-none -O -fconvert=big-endia</div><div>n -frecord-marker=4</div><div>F77FLAGS = -ffree-form -O -fconvert=big-endian -frecord-marker=4</div><div>FCSUFFIX = </div>
<div>FNGFLAGS = $(FFLAGS)</div><div>LDFLAGS = -g</div><div>CFLAGS = -g</div><div>CPP = /lib/cpp -C -P</div><div>CPPFLAGS = -D_UNDERSCORE -DBYTESWAP -DWIN32 -DIO_NETCDF -DIO_BINARY -</div>
<div>DIO_GRIB1 -DBIT32 </div><div>ARFLAGS =</div><div><br></div><div>################################################################################</div><div>########################################</div><div>
#</div><div># Macros, these should be generic for all machines</div><div><br></div><div>LN = ln -sf</div><div><div>MAKE = make -i -r</div><div>RM = /bin/rm -f</div>
<div>CP = /bin/cp</div><div>AR = ar ru</div><div><br></div><div>.IGNORE:</div><div>.SUFFIXES: .c .f .F .o</div><div><br></div><div># There is probably no reason to modify these rules</div>
<div><br></div><div>.c.o:</div><div> $(RM) $@</div><div> $(CC) $(CPPFLAGS) $(CFLAGS) -c $<</div><div><br></div><div>.f.o:</div><div> $(RM) $@ $*.mod</div><div> $(FC) $(F77FLAGS) -c $< $(WRF_INCLUDE)</div>
<div><br></div><div>.F.o:</div><div> $(RM) $@ $*.mod</div><div> $(CPP) $(CPPFLAGS) $(FDEFS) $(WRF_INCLUDE) $< > $*.f90</div><div> $(FC) $(FFLAGS) -c $*.f90 $(WRF_INCLUDE)</div><div># $(RM) $*.f90</div>
<div><br></div></div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">And here is my log file </div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>gfortran -g -o geogrid.exe cio.o wrf_debug.o bitarray_module.o constants_module.o module_stringutil.o geogrid.o gridinfo_module.o hash_module.o interp_module.o list_module.o llxy_module.o misc_definitions_module.o module_debug.o module_map_utils.o output_module.o parallel_module.o process_tile_module.o proc_point_module.o queue_module.o read_geogrid.o smooth_module.o source_data_module.o \</div>
<div><span style="white-space:pre-wrap">        </span>../../../WRFV3/frame/module_driver_constants.o \</div><div><span style="white-space:pre-wrap">        </span>../../../WRFV3/frame/pack_utils.o ../../../WRFV3/frame/module_machine.o \</div>
<div><span style="white-space:pre-wrap">        </span>../../../WRFV3/frame/module_internal_header_util.o \</div><div><span style="white-space:pre-wrap">        </span>-I../../../WRFV3/external/io_netcdf -I../../../WRFV3/external/io_grib_share -I../../../WRFV3/external/io_grib1 -I../../../WRFV3/external/io_int -I../../../WRFV3/inc -I/home/lenovo/gz/WPS/netcdf_links/include \</div>
<div><span style="white-space:pre-wrap">        </span>../../../WRFV3/external/io_grib1/libio_grib1.a ../../../WRFV3/external/io_grib_share/libio_grib_share.a ../../../WRFV3/external/io_int/libwrfio_int.a ../../../WRFV3/external/io_netcdf/libwrfio_nf.a /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdf.a /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a \</div>
<div><span style="white-space:pre-wrap">        </span></div><div>/home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-misc.o): In function `nf_inq_libvers_':</div><div>/home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-misc.c:20: undefined reference to `nc_inq_libvers'</div>
<div>/home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-misc.o): In function `nf_strerror_':</div><div>/home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-misc.c:36: undefined reference to `nc_strerror'</div><div>
/home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In function `nf_put_vara_text_':</div><div>/home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:22: undefined reference to `nc_put_vara_text'</div>
<div>/home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In function `nf_get_vara_text_':</div><div>/home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:29: undefined reference to `nc_get_vara_text'</div>
<div>/home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In function `nf_put_vara_int1_':</div><div>/home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:37: undefined reference to `nc_put_vara_schar'</div>
<div>/home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In function `nf_get_vara_int1_':</div><div>/home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:55: undefined reference to `nc_get_vara_schar'</div>
<div>/home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In function `nf_put_vara_int2_':</div><div>/home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:73: undefined reference to `nc_put_vara_short'</div>
</div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div><div class="">
_______________________________________________<br>Wrf-users mailing list<br><a href="mailto:Wrf-users@ucar.edu" target="_blank">Wrf-users@ucar.edu</a><br><a href="http://mailman.ucar.edu/mailman/listinfo/wrf-users" target="_blank">http://mailman.ucar.edu/mailman/listinfo/wrf-users</a><br>
</div></blockquote></div><br></div></blockquote></div><br></div>