def download(paramFN, paramDL):
    try:
        print("Working on time index: " + str(paramFN))
        #Multidimension Supplemental Tools are required!
        arcpy.ImportToolbox(mstToolboxPath, "mds")

        #Get present date
        patternDate = '%Y%m%d'
        global stringDateNow
        if stringDateNow == None:
            stringDateNow = datetime.utcnow().strftime(patternDate)
        print("Target date: " + str(stringDateNow))

        noaaURLBase = r"http://nomads.ncep.noaa.gov/dods/nam/nam%s/nam" + paramDL
        noaaURL = noaaURLBase % stringDateNow
        #filename = "nam%s1hr00z.nc" % stringDateNow

        print("Building forecast data...")
        netcdfDataFileBase = os.path.join(netcdfFolder, r"nam%s" + paramFN + ".nc") % stringDateNow
        if checkOSExists(netcdfDataFileBase):
            print("deleting existing " + str(netcdfDataFileBase))
            removeFile(netcdfDataFileBase)
        forecastVariable = r"rh2m;tcdcclm;tmpsfc;hgtclb;vissfc;ugrd10m;vgrd10m;ugrdmwl;vgrdmwl;snodsfc;gustsfc;apcpsfc"
        operationalData = os.path.join(maowOperationalWeatherGeodatabase, "OperationalData")
        result = process(noaaURL, forecastVariable, netcdfDataFileBase, operationalData)

        print("Building wind data...")
        netcdfWindFileBase = os.path.join(netcdfFolder, r"nam%s" + paramFN + "Wind.nc") % stringDateNow
        if checkOSExists(netcdfWindFileBase):
            print("deleting existing " + str(netcdfWindFileBase))
            removeFile(netcdfWindFileBase)
        windVariable = r"ugrd10m;vgrd10m"
        operationalWind = os.path.join(maowOperationalWeatherGeodatabase, "OperationalWind")
        result = process(noaaURL, windVariable, netcdfWindFileBase, operationalWind)

        print("Done.")

    except NAMDownloadException as e:
        print("Error in main: \n" + str(e.tb))

# get the present time in utc.
# set times are set around the times that the data is released by NOAA
main work method
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/NAMDownload.py/download